summaryrefslogtreecommitdiffstatshomepage
path: root/py/compile.c
diff options
context:
space:
mode:
authorDamien George <damien@micropython.org>2022-07-26 12:24:50 +1000
committerDamien George <damien@micropython.org>2022-07-26 12:24:50 +1000
commitc0fa903d6b2ed5131ae60f8faff2c6ad5276b3a2 (patch)
tree9fbc915ca9b397c2ffafa1d849c6c751577d46a3 /py/compile.c
parent0c45a28d24e1a7f9ea5912c928d7b5a860a6514a (diff)
downloadmicropython-c0fa903d6b2ed5131ae60f8faff2c6ad5276b3a2.tar.gz
micropython-c0fa903d6b2ed5131ae60f8faff2c6ad5276b3a2.zip
py/compile: Support large integers in inline-asm data directive.
Fixes issue #8956. Signed-off-by: Damien George <damien@micropython.org>
Diffstat (limited to 'py/compile.c')
-rw-r--r--py/compile.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/py/compile.c b/py/compile.c
index ff3e5ffc6d..8aaf885327 100644
--- a/py/compile.c
+++ b/py/compile.c
@@ -3286,12 +3286,13 @@ STATIC void compile_scope_inline_asm(compiler_t *comp, scope_t *scope, pass_kind
if (pass > MP_PASS_SCOPE) {
mp_int_t bytesize = MP_PARSE_NODE_LEAF_SMALL_INT(pn_arg[0]);
for (uint j = 1; j < n_args; j++) {
- if (!MP_PARSE_NODE_IS_SMALL_INT(pn_arg[j])) {
+ mp_obj_t int_obj;
+ if (!mp_parse_node_get_int_maybe(pn_arg[j], &int_obj)) {
compile_syntax_error(comp, nodes[i], MP_ERROR_TEXT("'data' requires integer arguments"));
return;
}
mp_asm_base_data((mp_asm_base_t *)comp->emit_inline_asm,
- bytesize, MP_PARSE_NODE_LEAF_SMALL_INT(pn_arg[j]));
+ bytesize, mp_obj_int_get_truncated(int_obj));
}
}
} else {