Skip to content

Commit d5b42db

Browse files
authored
[clang][bytecode][NFC] Only do CheckConstant checks for global pointers (#113786)
We can check isStatic() early here and save ourselves some work.
1 parent 355e694 commit d5b42db

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

clang/lib/AST/ByteCode/Interp.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -400,7 +400,7 @@ bool CheckConstant(InterpState &S, CodePtr OpPC, const Descriptor *Desc) {
400400
}
401401

402402
static bool CheckConstant(InterpState &S, CodePtr OpPC, const Pointer &Ptr) {
403-
if (!Ptr.isBlockPointer())
403+
if (!Ptr.isStatic() || !Ptr.isBlockPointer())
404404
return true;
405405
return CheckConstant(S, OpPC, Ptr.getDeclDesc());
406406
}

0 commit comments

Comments
 (0)