Commit dc790977 authored by Damien George's avatar Damien George
Browse files

py: In inline assembler, reset labels on code-size pass.

parent 3665d0b2
...@@ -63,7 +63,6 @@ emit_inline_asm_t *emit_inline_thumb_new(mp_uint_t max_num_labels) { ...@@ -63,7 +63,6 @@ emit_inline_asm_t *emit_inline_thumb_new(mp_uint_t max_num_labels) {
emit_inline_asm_t *emit = m_new_obj(emit_inline_asm_t); emit_inline_asm_t *emit = m_new_obj(emit_inline_asm_t);
emit->max_num_labels = max_num_labels; emit->max_num_labels = max_num_labels;
emit->label_lookup = m_new(qstr, max_num_labels); emit->label_lookup = m_new(qstr, max_num_labels);
memset(emit->label_lookup, 0, emit->max_num_labels * sizeof(qstr));
emit->as = asm_thumb_new(max_num_labels); emit->as = asm_thumb_new(max_num_labels);
return emit; return emit;
} }
...@@ -78,6 +77,9 @@ STATIC void emit_inline_thumb_start_pass(emit_inline_asm_t *emit, pass_kind_t pa ...@@ -78,6 +77,9 @@ STATIC void emit_inline_thumb_start_pass(emit_inline_asm_t *emit, pass_kind_t pa
emit->pass = pass; emit->pass = pass;
emit->scope = scope; emit->scope = scope;
emit->error_slot = error_slot; emit->error_slot = error_slot;
if (emit->pass == MP_PASS_CODE_SIZE) {
memset(emit->label_lookup, 0, emit->max_num_labels * sizeof(qstr));
}
asm_thumb_start_pass(emit->as, pass == MP_PASS_EMIT ? ASM_THUMB_PASS_EMIT : ASM_THUMB_PASS_COMPUTE); asm_thumb_start_pass(emit->as, pass == MP_PASS_EMIT ? ASM_THUMB_PASS_EMIT : ASM_THUMB_PASS_COMPUTE);
asm_thumb_entry(emit->as, 0); asm_thumb_entry(emit->as, 0);
} }
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment