davidgiven / ack

The Amsterdam Compiler Kit
http://tack.sf.net
Other
428 stars 62 forks source link

[bug] lar instruction does not accept negative bounds in interpreter when doing array index checking #194

Closed ccodere closed 5 years ago

ccodere commented 5 years ago

The LAR instruction execution in the interpreter does not properly manage bounds checking, it would cause false positives on illegal bounds for example when the lower bound is specified as being negative. This could also cause issues of out of index errors not being detected.

The issue is do_array in arr(). The check should be done on the index to see if it is out of bounds, not on the bounds difference.

Will be fixed in next commit.