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).
This commit is contained in:
Damien George
2019-03-07 22:46:04 +11:00
parent 02cc288edb
commit 01a1f31f67
2 changed files with 1 additions and 9 deletions

View File

@@ -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);