summaryrefslogtreecommitdiffstatshomepage
path: root/py/vm.c
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2014-01-29 18:58:52 +0000
committerDamien George <damien.p.george@gmail.com>2014-01-29 18:58:52 +0000
commit08d075592f3fa958ac3f24e176bee5ab56e78f49 (patch)
tree6b09520f0cabc7330dda34bd2da8c17bff3d8b79 /py/vm.c
parent1ba1facaaa112c02fd3dcc1bfcb8e228787629ed (diff)
downloadmicropython-08d075592f3fa958ac3f24e176bee5ab56e78f49.tar.gz
micropython-08d075592f3fa958ac3f24e176bee5ab56e78f49.zip
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.
Diffstat (limited to 'py/vm.c')
-rw-r--r--py/vm.c5
1 files changed, 1 insertions, 4 deletions
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: