Fix malformed program crasher
This commit is contained in:
3
parse.yy
3
parse.yy
@@ -1435,7 +1435,8 @@ lAddFunctionParams(Declarator *decl) {
|
|||||||
Symbol *sym = pdecl->declarators[0]->GetSymbol();
|
Symbol *sym = pdecl->declarators[0]->GetSymbol();
|
||||||
#ifndef NDEBUG
|
#ifndef NDEBUG
|
||||||
bool ok = m->symbolTable->AddVariable(sym);
|
bool ok = m->symbolTable->AddVariable(sym);
|
||||||
assert(ok); // or error message?
|
if (ok == false)
|
||||||
|
assert(m->errorCount > 0);
|
||||||
#else
|
#else
|
||||||
m->symbolTable->AddVariable(sym);
|
m->symbolTable->AddVariable(sym);
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
5
tests_errors/func-param-redeclare.ispc
Normal file
5
tests_errors/func-param-redeclare.ispc
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
// Ignoring redeclaration of symbol "a"
|
||||||
|
|
||||||
|
int foo(int a[], int a) {
|
||||||
|
return a[i];
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user