Bug 164002

Summary: Kst crashes after accessing the flagVector array of the VectorView Class
Product: [Applications] kst Reporter: Yiwen Mao <yiwenv>
Component: scriptingAssignee: kst
Status: RESOLVED FIXED    
Severity: crash    
Priority: NOR    
Version: 1.x   
Target Milestone: ---   
Platform: unspecified   
OS: Linux   
Latest Commit: Version Fixed In:

Description Yiwen Mao 2008-06-13 23:14:25 UTC
Version:           1.7.0 (using KDE 4.0.1)
Installed from:    Unspecified
Compiler:          Fedora 6 
OS:                Linux

Kst will crash when try to access the array of the flagVector for a VectorView

//construct two vectors to create a VectorView
kst> x=new Vector();
Vector
kst> x.resize(10);
undefined
kst> for(var i=0;i<10;i++){x[i]=i+1}
10
kst> y=x;
Vector
kst> v=new VectorView(x,y)
VectorView

//construct a new Vector as a flag vector
kst> f=new Vector()
Vector
kst> f.resize(10)
undefined
kst> f.zero()
undefined
kst> f[2]=1
1
kst> f[5]=1
1
kst> f.array
0,0,1,0,0,1,0,0,0,0

//assign f as the flagVector for v
kst> v.flagVector=f;
Vector

//try to access the values of the flagVector
 v.flagVector.array 

//Kst crashes
Comment 1 Andrew Walker 2008-06-14 01:27:42 UTC
SVN commit 820358 by arwalker:

BUG:164002 the flag vector for a VectorView object is an input vector and not an output vector. Change code accordingly

 M  +1 -1      bind_vectorview.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=820358