Skip to content

Commit 9a270cc

Browse files
committed
Fix 32-bit platforms
1 parent 298bc27 commit 9a270cc

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

mypyc/irbuild/ll_builder.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -509,10 +509,12 @@ def coerce_int_to_fixed_width(self, src: Value, target_type: RType, line: int) -
509509
return res
510510

511511
def coerce_short_int_to_fixed_width(self, src: Value, target_type: RType, line: int) -> Value:
512-
if is_int64_rprimitive(target_type):
512+
if is_int64_rprimitive(target_type) or (
513+
PLATFORM_SIZE == 4 and is_int32_rprimitive(target_type)
514+
):
513515
return self.int_op(target_type, src, Integer(1, target_type), IntOp.RIGHT_SHIFT, line)
514-
# TODO: i32
515-
assert False, (src.type, target_type)
516+
# TODO: i32 on 64-bit platform
517+
assert False, (src.type, target_type, PLATFORM_SIZE)
516518

517519
def coerce_fixed_width_to_int(self, src: Value, line: int) -> Value:
518520
if (

0 commit comments

Comments
 (0)