dwarf2: Correctly initialize dwarf2_line_info.errwarns

Forgetting to this causes unexpected control flow transfers and even
misoptimizations. When building with LLVM 20.1.4 and LTO enabled,
misoptimizations will ultimately lead to segfaults in
dwarf2_gen64_test.sh.

Signed-off-by: Yao Zi <ziyao@disroot.org>
This commit is contained in:
Yao Zi 2025-06-01 03:09:20 +00:00 committed by Peter Johnson
parent b9c3fe6399
commit a2f8bdf075

View file

@ -709,6 +709,7 @@ yasm_dwarf2__generate_line(yasm_object *object, yasm_linemap *linemap,
info.dbgfmt_dwarf2 = dbgfmt_dwarf2;
info.debug_line = yasm_object_get_general(object, ".debug_line", 1, 0, 0,
&new, 0);
info.errwarns = errwarns;
/* header */
head = yasm_dwarf2__add_head(dbgfmt_dwarf2, info.debug_line, NULL, 0, 0);