From 4e2c983b0f6eda469718778d4848fbdb3e0db81f Mon Sep 17 00:00:00 2001 From: Nikita Smith Date: Thu, 16 Oct 2025 17:49:41 -0700 Subject: [PATCH] skip leading NOP opcodes, which caused extra CFI rows to be emitted --- src/dwarf/dwarf_unwind.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/dwarf/dwarf_unwind.c b/src/dwarf/dwarf_unwind.c index de765be6..89b3b250 100644 --- a/src/dwarf/dwarf_unwind.c +++ b/src/dwarf/dwarf_unwind.c @@ -67,6 +67,14 @@ dw_cfi_next_row(Arena *arena, DW_CFI_Unwind *uw) { B32 is_row_valid = 0; + // skip leading nops + while (uw->curr_inst) { + if (uw->curr_inst->v.opcode != DW_CFA_Nop) { + break; + } + uw->curr_inst = uw->curr_inst->next; + } + while (uw->curr_inst) { DW_CFA_Inst *inst = &uw->curr_inst->v;