From 65ac59cb18b097251c7e6083f785562ba6278d82 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Sat, 24 Aug 2024 08:49:16 +0200 Subject: [PATCH] [clang][bytecode][NFC] Add an additional assertion Since this must be true, add an assertion instead of just documenting it via the comment. --- clang/lib/AST/ByteCode/Interp.h | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) 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; }