davidgiven / ack

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

[bug] signed integer shift left does not correctly check overflow in the interpreter when shifting by 0 bits #193

Closed ccodere closed 5 years ago

ccodere commented 5 years ago

The interpreter causes an "Integer Overflow" (EIOVFL) when trying to shift left of 0 bits a signed integer value. This is valid and should not cause any trap.

The issue is that the algorithm to check for overflow in the sli() procedure of do_intar.c did not correctly account of shifting by 0 bits.

Fixed locally and will be committed.