Skip to content

Commit 99b85ca

Browse files
authored
[clang][bytecode][NFC] Add an additional assertion (llvm#105927)
Since this must be true, add an assertion instead of just documenting it via the comment.
1 parent 76236fa commit 99b85ca

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

clang/lib/AST/ByteCode/Interp.h

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2608,9 +2608,11 @@ inline bool Call(InterpState &S, CodePtr OpPC, const Function *Func,
26082608
// the function we're about to call is a lambda call operator,
26092609
// skip the CheckInvoke, since the ThisPtr is a null pointer
26102610
// anyway.
2611-
if (!(S.Current->getFunction() &&
2612-
S.Current->getFunction()->isLambdaStaticInvoker() &&
2613-
Func->isLambdaCallOperator())) {
2611+
if (S.Current->getFunction() &&
2612+
S.Current->getFunction()->isLambdaStaticInvoker() &&
2613+
Func->isLambdaCallOperator()) {
2614+
assert(ThisPtr.isZero());
2615+
} else {
26142616
if (!CheckInvoke(S, OpPC, ThisPtr))
26152617
return false;
26162618
}

0 commit comments

Comments
 (0)