aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCary Coutant <ccoutant@google.com>2015-03-25 15:27:52 -0700
committerCary Coutant <ccoutant@google.com>2015-03-25 15:27:52 -0700
commit83222732f13c2b1c316d6d62c44f18cff3a0c927 (patch)
tree5c46d8e74bc0dd729ebc473726eb30cc0c8cc024
parentc312754797926d284cd575782d3dc6e1ce14b2ba (diff)
downloadgdb-users/ccoutant/two-level-line-tables.zip
gdb-users/ccoutant/two-level-line-tables.tar.gz
gdb-users/ccoutant/two-level-line-tables.tar.bz2
Fix crash when section ends with a .lloc directive not followed by an insn.users/ccoutant/two-level-line-tables
gas/ * dwarf2dbg.c (emit_logicals): Handle case where e->label is NULL.
-rw-r--r--gas/dwarf2dbg.c35
1 files changed, 21 insertions, 14 deletions
diff --git a/gas/dwarf2dbg.c b/gas/dwarf2dbg.c
index dfd3d63..35f6df6 100644
--- a/gas/dwarf2dbg.c
+++ b/gas/dwarf2dbg.c
@@ -1630,25 +1630,32 @@ emit_logicals (void)
out_opcode (DW_LNS_set_epilogue_begin);
line_delta = e->loc.line - line;
- lab = e->label;
- frag = symbol_get_frag (lab);
- frag_ofs = S_GET_VALUE (lab);
-
- if (last_frag == NULL || e->seg != last_seg)
+ if (e->label == NULL)
{
- out_set_addr (lab);
out_inc_line_addr (line_delta, 0);
}
- else if (frag == last_frag && ! DWARF2_USE_FIXED_ADVANCE_PC)
- out_inc_line_addr (line_delta, frag_ofs - last_frag_ofs);
else
- relax_inc_line_addr (line_delta, lab, last_lab);
+ {
+ lab = e->label;
+ frag = symbol_get_frag (lab);
+ frag_ofs = S_GET_VALUE (lab);
- line = e->loc.line;
- last_seg = e->seg;
- last_lab = lab;
- last_frag = frag;
- last_frag_ofs = frag_ofs;
+ if (last_frag == NULL || e->seg != last_seg)
+ {
+ out_set_addr (lab);
+ out_inc_line_addr (line_delta, 0);
+ }
+ else if (frag == last_frag && ! DWARF2_USE_FIXED_ADVANCE_PC)
+ out_inc_line_addr (line_delta, frag_ofs - last_frag_ofs);
+ else
+ relax_inc_line_addr (line_delta, lab, last_lab);
+
+ line = e->loc.line;
+ last_seg = e->seg;
+ last_lab = lab;
+ last_frag = frag;
+ last_frag_ofs = frag_ofs;
+ }
}
}