From 08d075592f3fa958ac3f24e176bee5ab56e78f49 Mon Sep 17 00:00:00 2001 From: Damien George Date: Wed, 29 Jan 2014 18:58:52 +0000 Subject: py: Fix bug with LOAD_METHOD; fix int->machine_int_t for small int. LOAD_METHOD bug was: emitbc did not correctly calculate the amount of stack usage for a LOAD_METHOD operation. small int bug was: int was being used to pass small ints, when it should have been machine_int_t. --- py/vm.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'py/vm.c') diff --git a/py/vm.c b/py/vm.c index 0cc26021e8..cb4c6a8f73 100644 --- a/py/vm.c +++ b/py/vm.c @@ -26,8 +26,6 @@ #define SET_TOP(val) *sp = (val) mp_obj_t mp_execute_byte_code(const byte *code, const mp_obj_t *args, uint n_args, uint n_state) { - n_state += 1; // XXX there is a bug somewhere which doesn't count enough state... (conwaylife and mandel have the bug) - // allocate state for locals and stack mp_obj_t temp_state[10]; mp_obj_t *state = &temp_state[0]; @@ -479,8 +477,7 @@ bool mp_execute_byte_code_2(const byte *code_info, const byte **ip_in_out, mp_ob case MP_BC_MAKE_CLOSURE: DECODE_UINT; - obj1 = POP(); - PUSH(rt_make_closure_from_id(unum, obj1)); + SET_TOP(rt_make_closure_from_id(unum, TOP())); break; case MP_BC_CALL_FUNCTION: -- cgit v1.2.3