[ROOT] cint bug: a[i][j]*a[i][j]

From: Chris Crawford (chris2@lns.mit.edu)
Date: Fri Feb 15 2002 - 21:25:28 MET


i would like to report a couple of eccentric bugs in cint 5.15.20
illustrated by the following code "err.c":

float sub(float** a) {return a[0][0]+a[0][0];}
void err() { float **b = new float*; *b= new float(2.);
 for(int i=0;i==0;i++) { printf("%f\n",sub(b)); }}
void er2() { float **c = new float*; *c= new float; **c=3.;
 for(int i=0;i==0;i++) { printf("%f\n",sub(c)); }}

err() reports the error "Error: +" but still seems to work.  it does so
with either 'new' or 'malloc', only inside a 'for' or 'while' loop,
which calls 'a[0][0]+a[0][0]' from a function.  using '**a + **a' won't
report an error.

er2() crashes at **c=3, only when followed by the next line.

any thoughts???
--Chris Crawford



This archive was generated by hypermail 2b29 : Sat Jan 04 2003 - 23:50:41 MET