asm_write_{init, exit} when asm_translate_nodes

This commit is contained in:
2024-12-03 04:22:59 +00:00
parent 4332862fa3
commit 87fa534a7a

View File

@@ -119,6 +119,7 @@ void ast_ref_to_asm_label(u64, struct Label *, u64, i64 *, i64 *);
void asm_translate_nodes(buffer_t **asm_buffer, struct PResult nodes, void asm_translate_nodes(buffer_t **asm_buffer, struct PResult nodes,
const char *src_name) const char *src_name)
{ {
asm_write_init(asm_buffer);
// First pass: Setup the ASM label array // First pass: Setup the ASM label array
struct Label labels[nodes.labels ? nodes.labels * 2 : 1]; struct Label labels[nodes.labels ? nodes.labels * 2 : 1];
if (nodes.labels) if (nodes.labels)
@@ -184,6 +185,7 @@ void asm_translate_nodes(buffer_t **asm_buffer, struct PResult nodes,
table[node.type].len); table[node.type].len);
} }
} }
asm_write_exit(asm_buffer);
} }
/* Implementations for throwaway functions */ /* Implementations for throwaway functions */