PR22167, NULL pointer dereference in scan_unit_for_symbols

PR 22167
	* dwarf2.c (scan_unit_for_symbols): Check u.blk->data is non-NULL.
This commit is contained in:
Alan Modra 2017-09-24 14:35:33 +09:30
parent bd61e13549
commit 0d76029f92
2 changed files with 7 additions and 1 deletions

View File

@ -1,3 +1,8 @@
2017-09-24 Alan Modra <amodra@gmail.com>
PR 22167
* dwarf2.c (scan_unit_for_symbols): Check u.blk->data is non-NULL.
2017-09-24 Alan Modra <amodra@gmail.com>
PR 22166

View File

@ -3210,7 +3210,8 @@ scan_unit_for_symbols (struct comp_unit *unit)
case DW_FORM_block2:
case DW_FORM_block4:
case DW_FORM_exprloc:
if (*attr.u.blk->data == DW_OP_addr)
if (attr.u.blk->data != NULL
&& *attr.u.blk->data == DW_OP_addr)
{
var->stack = 0;