diff --git a/clang/lib/AST/ByteCode/Interp.h b/clang/lib/AST/ByteCode/Interp.h index 7ba51f737db49..81c547991c3d7 100644 --- a/clang/lib/AST/ByteCode/Interp.h +++ b/clang/lib/AST/ByteCode/Interp.h @@ -2608,9 +2608,11 @@ inline bool Call(InterpState &S, CodePtr OpPC, const Function *Func, // the function we're about to call is a lambda call operator, // skip the CheckInvoke, since the ThisPtr is a null pointer // anyway. - if (!(S.Current->getFunction() && - S.Current->getFunction()->isLambdaStaticInvoker() && - Func->isLambdaCallOperator())) { + if (S.Current->getFunction() && + S.Current->getFunction()->isLambdaStaticInvoker() && + Func->isLambdaCallOperator()) { + assert(ThisPtr.isZero()); + } else { if (!CheckInvoke(S, OpPC, ThisPtr)) return false; }