diff options
author | Damien George <damien.p.george@gmail.com> | 2014-01-29 18:58:52 +0000 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2014-01-29 18:58:52 +0000 |
commit | 08d075592f3fa958ac3f24e176bee5ab56e78f49 (patch) | |
tree | 6b09520f0cabc7330dda34bd2da8c17bff3d8b79 /py/parse.c | |
parent | 1ba1facaaa112c02fd3dcc1bfcb8e228787629ed (diff) | |
download | micropython-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/parse.c')
-rw-r--r-- | py/parse.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/py/parse.c b/py/parse.c index d9969d6785..d0776cefba 100644 --- a/py/parse.c +++ b/py/parse.c @@ -172,15 +172,15 @@ void mp_parse_node_print(mp_parse_node_t pn, int indent) { if (MP_PARSE_NODE_IS_NULL(pn)) { printf("NULL\n"); } else if (MP_PARSE_NODE_IS_LEAF(pn)) { - int arg = MP_PARSE_NODE_LEAF_ARG(pn); + machine_int_t arg = MP_PARSE_NODE_LEAF_ARG(pn); switch (MP_PARSE_NODE_LEAF_KIND(pn)) { case MP_PARSE_NODE_ID: printf("id(%s)\n", qstr_str(arg)); break; - case MP_PARSE_NODE_SMALL_INT: printf("int(%d)\n", arg); break; + case MP_PARSE_NODE_SMALL_INT: printf("int(" INT_FMT ")\n", arg); break; case MP_PARSE_NODE_INTEGER: printf("int(%s)\n", qstr_str(arg)); break; case MP_PARSE_NODE_DECIMAL: printf("dec(%s)\n", qstr_str(arg)); break; case MP_PARSE_NODE_STRING: printf("str(%s)\n", qstr_str(arg)); break; case MP_PARSE_NODE_BYTES: printf("bytes(%s)\n", qstr_str(arg)); break; - case MP_PARSE_NODE_TOKEN: printf("tok(%d)\n", arg); break; + case MP_PARSE_NODE_TOKEN: printf("tok(" INT_FMT ")\n", arg); break; default: assert(0); } } else { |