Fix malformed program crasher

This commit is contained in:
Matt Pharr
2011-11-16 16:22:38 -08:00
parent 7290f7b16b
commit f5a21d96a1
2 changed files with 7 additions and 1 deletions

View File

@@ -1435,7 +1435,8 @@ lAddFunctionParams(Declarator *decl) {
Symbol *sym = pdecl->declarators[0]->GetSymbol();
#ifndef NDEBUG
bool ok = m->symbolTable->AddVariable(sym);
assert(ok); // or error message?
if (ok == false)
assert(m->errorCount > 0);
#else
m->symbolTable->AddVariable(sym);
#endif

View File

@@ -0,0 +1,5 @@
// Ignoring redeclaration of symbol "a"
int foo(int a[], int a) {
return a[i];
}