I think a more bare bones case of the issue reported in #125 is
int main(void)
{
if (0) {
T(T);
}
}
After marking the ambiguity, when reparsing the if statement, elseStmt_ is nullptr and is passed on to visitMaybeAmbiguousStatement, causing a null pointer dereference.
I think a more bare bones case of the issue reported in #125 is
After marking the ambiguity, when reparsing the if statement,
elseStmt_
isnullptr
and is passed on tovisitMaybeAmbiguousStatement
, causing a null pointer dereference.https://github.com/ltcmelo/psychec/blob/eabdcce6a57d9531acd7d7ebd1d43cbe918a73d0/C/reparser/Disambiguator.cpp#L385
https://github.com/ltcmelo/psychec/blob/eabdcce6a57d9531acd7d7ebd1d43cbe918a73d0/C/reparser/Disambiguator.cpp#L91
Simplistically, the PR proposes to account for both forms of if statements