Ticket #12 (defect)

Opened 1 year ago

Last modified 1 year ago

bug in array_declarators.upc

Status: closed (fixed)

Reported by: bonachea@cs.berkeley.edu Assigned to: apokayi
Priority: major Milestone:
Component: component1 Version:
Keywords: Cc:

In this code:

pp = (int *) &A[BLOCKS * MYTHREAD];

for(i=0; i<(BLOCKS*THREADS); i++){

if(((i/BLOCKS)%THREADS) == MYTHREAD){

if(*p != MYTHREAD)

GULA_FAIL("failed to apply type qualifier to the elements");

p++;

}

}

p should instead be pp in the loop.

also in the earlier code:

#define N 5 #define BLOCKS 3 shared int A[N*THREADS]; ...

pp = (int *) &A[BLOCKS * MYTHREAD];

for(i=0; i< BLOCKS; i++, p++)

*pp = MYTHREAD;

I believe this steps outside the array bounds, as (BLOCKS+BLOCKS-1) >= N

Change History

09/06/07 16:33:32: Modified by sbahra

  • owner changed from somebody to apokayi.

09/25/07 18:55:51: Modified by apokayi

  • status changed from new to closed.
  • resolution set to fixed.

typos were fixed