[TableGen] Fix use of *CurRec when CurRec is null.

I cannot build with the undefined sanitizer on Visual Studio.
This commit is contained in:
Paul C. Anagnostopoulos 2021-01-08 13:20:27 -05:00
parent 024af42c60
commit fe50b7363a
1 changed files with 1 additions and 4 deletions

View File

@ -3209,10 +3209,7 @@ bool TGParser::ParseAssert(MultiClass *CurMultiClass, Record *CurRec) {
} else if (CurRec) {
CurRec->addAssertion(ConditionLoc, Condition, Message);
} else { // at top level
RecordResolver R(*CurRec);
Init *Value = Condition->resolveReferences(R);
Init *Text = Message->resolveReferences(R);
CheckAssert(ConditionLoc, Value, Text);
CheckAssert(ConditionLoc, Condition, Message);
}
return false;