Partial fix of a malformed program crasher.
Starts to address issue #135, but then a later assertion hits.
This commit is contained in:
4
parse.yy
4
parse.yy
@@ -1566,7 +1566,9 @@ lAddFunctionParams(Declarator *decl) {
|
|||||||
// now loop over its parameters and add them to the symbol table
|
// now loop over its parameters and add them to the symbol table
|
||||||
for (unsigned int i = 0; i < decl->functionParams.size(); ++i) {
|
for (unsigned int i = 0; i < decl->functionParams.size(); ++i) {
|
||||||
Declaration *pdecl = decl->functionParams[i];
|
Declaration *pdecl = decl->functionParams[i];
|
||||||
if (pdecl == NULL)
|
if (pdecl == NULL || pdecl->declarators.size() == 0)
|
||||||
|
// zero size declarators array corresponds to an anonymous
|
||||||
|
// parameter
|
||||||
continue;
|
continue;
|
||||||
assert(pdecl->declarators.size() == 1);
|
assert(pdecl->declarators.size() == 1);
|
||||||
Symbol *sym = pdecl->declarators[0]->GetSymbol();
|
Symbol *sym = pdecl->declarators[0]->GetSymbol();
|
||||||
|
|||||||
Reference in New Issue
Block a user