Skip to content

Commit 4687017

Browse files
committed
[clang][bytecode][NFC] Fix CallBI function signature
This doesn't modify the PC, so pass OpPC as a copy.
1 parent 44556e6 commit 4687017

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

clang/lib/AST/ByteCode/Interp.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1177,16 +1177,16 @@ bool CallVirt(InterpState &S, CodePtr OpPC, const Function *Func,
11771177
return true;
11781178
}
11791179

1180-
bool CallBI(InterpState &S, CodePtr &PC, const Function *Func,
1180+
bool CallBI(InterpState &S, CodePtr OpPC, const Function *Func,
11811181
const CallExpr *CE, uint32_t BuiltinID) {
11821182
if (S.checkingPotentialConstantExpression())
11831183
return false;
1184-
auto NewFrame = std::make_unique<InterpFrame>(S, Func, PC);
1184+
auto NewFrame = std::make_unique<InterpFrame>(S, Func, OpPC);
11851185

11861186
InterpFrame *FrameBefore = S.Current;
11871187
S.Current = NewFrame.get();
11881188

1189-
if (InterpretBuiltin(S, PC, Func, CE, BuiltinID)) {
1189+
if (InterpretBuiltin(S, OpPC, Func, CE, BuiltinID)) {
11901190
NewFrame.release();
11911191
return true;
11921192
}

clang/lib/AST/ByteCode/Interp.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ bool Call(InterpState &S, CodePtr OpPC, const Function *Func,
154154
uint32_t VarArgSize);
155155
bool CallVirt(InterpState &S, CodePtr OpPC, const Function *Func,
156156
uint32_t VarArgSize);
157-
bool CallBI(InterpState &S, CodePtr &PC, const Function *Func,
157+
bool CallBI(InterpState &S, CodePtr OpPC, const Function *Func,
158158
const CallExpr *CE, uint32_t BuiltinID);
159159
bool CallPtr(InterpState &S, CodePtr OpPC, uint32_t ArgSize,
160160
const CallExpr *CE);

0 commit comments

Comments
 (0)