Prevent segfault in stabs64_typevalue

Prevent segfault when type == STT_OBJECT and no symbol
has been defined.
This commit is contained in:
Charles Crayne 2008-01-27 12:49:20 -08:00
parent 5a99f4f2f0
commit f3d2d41e06
2 changed files with 2 additions and 2 deletions

@ -1486,7 +1486,7 @@ void stabs32_typevalue(int32_t type)
stype = STT_NOTYPE;
break;
}
if (stype == STT_OBJECT && !lastsym->type) {
if (stype == STT_OBJECT && lastsym && !lastsym->type) {
lastsym->size = ssize;
lastsym->type = stype;
}

@ -1500,7 +1500,7 @@ void stabs64_typevalue(int32_t type)
stype = STT_NOTYPE;
break;
}
if (stype == STT_OBJECT && !lastsym->type) {
if (stype == STT_OBJECT && lastsym && !lastsym->type) {
lastsym->size = ssize;
lastsym->type = stype;
}