[ObjC] Fix an assertion failure in EvaluateLValue

Look through parentheses when determining whether the expression is a
@selector expression.
This commit is contained in:
Akira Hatanaka 2022-11-15 13:55:12 -08:00
parent 6dee23919a
commit 063a43b4fd
2 changed files with 2 additions and 1 deletions

View File

@ -8228,7 +8228,7 @@ static bool EvaluateLValue(const Expr *E, LValue &Result, EvalInfo &Info,
bool InvalidBaseOK) {
assert(!E->isValueDependent());
assert(E->isGLValue() || E->getType()->isFunctionType() ||
E->getType()->isVoidType() || isa<ObjCSelectorExpr>(E));
E->getType()->isVoidType() || isa<ObjCSelectorExpr>(E->IgnoreParens()));
return LValueExprEvaluator(Info, Result, InvalidBaseOK).Visit(E);
}

View File

@ -15,5 +15,6 @@ void h() {
// Shouldn't crash.
g(&@selector(foo));
g(&(@selector(foo)));
}