Commit a5e7fbbc authored by John Zhang's avatar John Zhang

It's actually LONG_BIT-dependent.

parent 4468ed58
from rpython.rlib.rarithmetic import ovfcheck from rpython.rlib.rarithmetic import ovfcheck, LONG_BIT
from rpython.rlib.rbigint import rbigint from rpython.rlib.rbigint import rbigint
from som.primitives.primitives import Primitives from som.primitives.primitives import Primitives
from som.vmobjects.integer import Integer from som.vmobjects.integer import Integer
...@@ -105,7 +105,7 @@ def _leftShift(ivkbl, frame, interpreter): ...@@ -105,7 +105,7 @@ def _leftShift(ivkbl, frame, interpreter):
l = left.get_embedded_integer() l = left.get_embedded_integer()
r = right.get_embedded_integer() r = right.get_embedded_integer()
try: try:
if not (l == 0 or 0 <= r <= 63): if not (l == 0 or 0 <= r < LONG_BIT):
raise OverflowError raise OverflowError
result = ovfcheck(l << r) result = ovfcheck(l << r)
frame.push(universe.new_integer(result)) frame.push(universe.new_integer(result))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment