summaryrefslogtreecommitdiffstatshomepage
path: root/py/vm.c
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2014-03-22 20:43:45 +0000
committerDamien George <damien.p.george@gmail.com>2014-03-22 20:43:45 +0000
commitffa37db5c5751bcc8edd719e778cad03aa15b419 (patch)
treeb30045d6a2bbd6116907e86bcfbc967d0e8e3e40 /py/vm.c
parent4ab128bbee5d0b0d05fec897182eef6a3a2e629f (diff)
downloadmicropython-ffa37db5c5751bcc8edd719e778cad03aa15b419.tar.gz
micropython-ffa37db5c5751bcc8edd719e778cad03aa15b419.zip
py: Fix int -> machine_uint_t.
Diffstat (limited to 'py/vm.c')
-rw-r--r--py/vm.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/py/vm.c b/py/vm.c
index 7f4efeea0f..2042e5a6ee 100644
--- a/py/vm.c
+++ b/py/vm.c
@@ -118,8 +118,8 @@ mp_vm_return_kind_t mp_execute_byte_code_2(const byte *code_info, const byte **i
mp_obj_t obj1, obj2;
nlr_buf_t nlr;
- volatile machine_uint_t currently_in_except_block = (int)*exc_sp_in_out & 1; // 0 or 1, to detect nested exceptions
- mp_exc_stack *volatile exc_sp = (void*)((int)*exc_sp_in_out & ~1); // stack grows up, exc_sp points to top of stack
+ volatile machine_uint_t currently_in_except_block = (machine_uint_t)*exc_sp_in_out & 1; // 0 or 1, to detect nested exceptions
+ 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
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)
// outer exception handling loop
@@ -607,7 +607,7 @@ unwind_return:
nlr_pop();
*ip_in_out = ip;
*sp_in_out = sp;
- *exc_sp_in_out = (void*)((int)exc_sp | currently_in_except_block);
+ *exc_sp_in_out = (void*)((machine_uint_t)exc_sp | currently_in_except_block);
return MP_VM_RETURN_YIELD;
case MP_BC_IMPORT_NAME: