forked from OSchip/llvm-project
[ObjC] Fix an assertion failure in EvaluateLValue
Look through parentheses when determining whether the expression is a @selector expression.
This commit is contained in:
parent
6dee23919a
commit
063a43b4fd
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
@ -15,5 +15,6 @@ void h() {
|
|||
|
||||
// Shouldn't crash.
|
||||
g(&@selector(foo));
|
||||
g(&(@selector(foo)));
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue