Issue #39: Prevent problem of inserting a zero-length symbol after cascading errors.

This commit is contained in:
John Kessenich 2015-07-25 18:14:09 -06:00
parent aead93aafd
commit 91b977e172

View file

@ -1626,12 +1626,13 @@ void TParseContext::variableCheck(TIntermTyped*& nodePtr)
error(symbol->getLoc(), "undeclared identifier", symbol->getName().c_str(), "");
// Add to symbol table to prevent future error messages on the same name
if (symbol->getName().size() > 0) {
TVariable* fakeVariable = new TVariable(&symbol->getName(), TType(EbtFloat));
symbolTable.insert(*fakeVariable);
// substitute a symbol node for this new variable
nodePtr = intermediate.addSymbol(*fakeVariable, symbol->getLoc());
}
} else {
switch (symbol->getQualifier().storage) {
case EvqPointCoord: