summaryrefslogtreecommitdiff
path: root/py/emitnative.c
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2019-03-07 22:46:04 +1100
committerDamien George <damien.p.george@gmail.com>2019-03-08 15:53:04 +1100
commit01a1f31f67ff6c9b6b1539783a8109dc380992fb (patch)
tree928a825ee2a08cc82523916fc27a753eb74c3d80 /py/emitnative.c
parent02cc288edbc47a3b21b88b83f15990cc5a36ed23 (diff)
py/emitnative: Consolidate where HASCONSTS is set to load-const-obj fun.
Simplifies the code and fixes handling of the Ellipsis const in native code generation (which also needs the constant table so must set this flag).
Diffstat (limited to 'py/emitnative.c')
-rw-r--r--py/emitnative.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/py/emitnative.c b/py/emitnative.c
index 0c756f9a5..f04de81cd 100644
--- a/py/emitnative.c
+++ b/py/emitnative.c
@@ -1250,6 +1250,7 @@ STATIC void emit_native_load_const_str(emit_t *emit, qstr qst) {
}
STATIC void emit_native_load_const_obj(emit_t *emit, mp_obj_t obj) {
+ emit->scope->scope_flags |= MP_SCOPE_FLAG_HASCONSTS;
emit_native_pre(emit);
need_reg_single(emit, REG_RET, 0);
emit_load_reg_with_object(emit, REG_RET, obj);