dbghelp: Made stabs parsing a bit more robust.
Enhance dbghelp's robustness against bogus stabs sections found in meetro.exe (as reported by Jan Zerebecki).
This commit is contained in:
parent
95d057a839
commit
83c30a55b8
@ -1327,13 +1327,17 @@ BOOL stabs_parse(struct module* module, unsigned long load_offset,
|
||||
stabs_parse_type(ptr));
|
||||
break;
|
||||
case N_LBRAC:
|
||||
block = symt_open_func_block(module, curr_func, block,
|
||||
stab_ptr->n_value, 0);
|
||||
pending_flush(&pending, module, curr_func, block);
|
||||
if (curr_func)
|
||||
{
|
||||
block = symt_open_func_block(module, curr_func, block,
|
||||
stab_ptr->n_value, 0);
|
||||
pending_flush(&pending, module, curr_func, block);
|
||||
}
|
||||
break;
|
||||
case N_RBRAC:
|
||||
block = symt_close_func_block(module, curr_func, block,
|
||||
stab_ptr->n_value);
|
||||
if (curr_func)
|
||||
block = symt_close_func_block(module, curr_func, block,
|
||||
stab_ptr->n_value);
|
||||
break;
|
||||
case N_PSYM:
|
||||
/* These are function parameters. */
|
||||
|
@ -365,6 +365,7 @@ struct symt_block* symt_close_func_block(struct module* module,
|
||||
struct symt_function* func,
|
||||
struct symt_block* block, unsigned pc)
|
||||
{
|
||||
assert(func);
|
||||
assert(func->symt.tag == SymTagFunction);
|
||||
|
||||
if (pc) block->size = func->address + pc - block->address;
|
||||
|
Loading…
x
Reference in New Issue
Block a user