Commit 4468ed58 by John Zhang

Fixed integer left shift overflow detection problem by assering the range of r.

1 parent 77fdbdc8
Showing with 2 additions and 0 deletions
......@@ -105,6 +105,8 @@ def _leftShift(ivkbl, frame, interpreter):
l = left.get_embedded_integer()
r = right.get_embedded_integer()
try:
if not (l == 0 or 0 <= r <= 63):
raise OverflowError
result = ovfcheck(l << r)
frame.push(universe.new_integer(result))
except OverflowError:
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!