Skip to content

Commit ffa37db

Browse files
committed
py: Fix int -> machine_uint_t.
1 parent 4ab128b commit ffa37db

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

py/vm.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -118,8 +118,8 @@ mp_vm_return_kind_t mp_execute_byte_code_2(const byte *code_info, const byte **i
118118
mp_obj_t obj1, obj2;
119119
nlr_buf_t nlr;
120120

121-
volatile machine_uint_t currently_in_except_block = (int)*exc_sp_in_out & 1; // 0 or 1, to detect nested exceptions
122-
mp_exc_stack *volatile exc_sp = (void*)((int)*exc_sp_in_out & ~1); // stack grows up, exc_sp points to top of stack
121+
volatile machine_uint_t currently_in_except_block = (machine_uint_t)*exc_sp_in_out & 1; // 0 or 1, to detect nested exceptions
122+
mp_exc_stack *volatile exc_sp = (void*)((machine_uint_t)*exc_sp_in_out & ~1); // stack grows up, exc_sp points to top of stack
123123
const byte *volatile save_ip = ip; // this is so we can access ip in the exception handler without making ip volatile (which means the compiler can't keep it in a register in the main loop)
124124

125125
// outer exception handling loop
@@ -607,7 +607,7 @@ mp_vm_return_kind_t mp_execute_byte_code_2(const byte *code_info, const byte **i
607607
nlr_pop();
608608
*ip_in_out = ip;
609609
*sp_in_out = sp;
610-
*exc_sp_in_out = (void*)((int)exc_sp | currently_in_except_block);
610+
*exc_sp_in_out = (void*)((machine_uint_t)exc_sp | currently_in_except_block);
611611
return MP_VM_RETURN_YIELD;
612612

613613
case MP_BC_IMPORT_NAME:

0 commit comments

Comments
 (0)