From: fennecdjay Date: Mon, 7 Oct 2019 19:20:06 +0000 (+0200) Subject: :bug: Fix member const builtin emition X-Git-Tag: nightly~2198^2~131 X-Git-Url: http://10.10.0.4:5575/?a=commitdiff_plain;h=139d31447a980b8b7e450f38b085fa9315d6aebe;p=gwion.git :bug: Fix member const builtin emition --- diff --git a/src/emit/emit.c b/src/emit/emit.c index 76632edb..3a98b371 100644 --- a/src/emit/emit.c +++ b/src/emit/emit.c @@ -1574,16 +1574,11 @@ ANN static m_bool emit_stmt_list(const Emitter emit, Stmt_List l) { } ANN static m_bool emit_dot_static_import_data(const Emitter emit, const Value v, const uint emit_addr) { - if(v->d.ptr && GET_FLAG(v, builtin)) { - if(GET_FLAG(v, enum)) - regpushi(emit, (m_uint)v->d.ptr); - else { - const m_uint size = v->type->size; - const Instr instr = emit_kind(emit, size, emit_addr, regpushimm); - instr->m_val = (isa(v->type, emit->gwion->type[et_object]) > 0 ? - (m_uint)&v->d.ptr : (m_uint)v->d.ptr); - instr->m_val2 = size; - } + if(v->d.ptr && GET_FLAG(v, builtin) && GET_FLAG(v, const)) { + const m_uint size = v->type->size; + const Instr instr = emit_kind(emit, size, emit_addr, regpushimm); + instr->m_val = (m_uint)v->d.ptr; + instr->m_val2 = size; return GW_OK; } return emit_dot_static_data(emit, v, emit_addr);