forked from OSchip/llvm-project
[demangler] return early if conditional expr parsing failed
This should fix some bugs found by oss-fuzz. llvm-svn: 324203
This commit is contained in:
parent
0398ccd0c9
commit
0923542c61
|
@ -2589,10 +2589,15 @@ Node *Db::parseExpr() {
|
|||
if (First[1] == 'u') {
|
||||
First += 2;
|
||||
Node *Cond = parseExpr();
|
||||
if (Cond == nullptr)
|
||||
return nullptr;
|
||||
Node *LHS = parseExpr();
|
||||
if (LHS == nullptr)
|
||||
return nullptr;
|
||||
Node *RHS = parseExpr();
|
||||
if (Cond && LHS && RHS)
|
||||
return make<ConditionalExpr>(Cond, LHS, RHS);
|
||||
if (RHS == nullptr)
|
||||
return nullptr;
|
||||
return make<ConditionalExpr>(Cond, LHS, RHS);
|
||||
}
|
||||
return nullptr;
|
||||
case 'r':
|
||||
|
|
Loading…
Reference in New Issue