Skip to content

Commit 62f0b7a

Browse files
Make opcode targets table dynamic
1 parent 81c975b commit 62f0b7a

File tree

3 files changed

+4
-2
lines changed

3 files changed

+4
-2
lines changed

Python/ceval.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1040,6 +1040,8 @@ _PyEval_EvalFrameDefault(PyThreadState *tstate, _PyInterpreterFrame *frame, int
10401040
return NULL;
10411041
}
10421042

1043+
void **opcode_targets = opcode_targets_table;
1044+
10431045
/* Local "register" variables.
10441046
* These are cached values from the frame and code object. */
10451047
_Py_CODEUNIT *next_instr;

Python/opcode_targets.h

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Tools/cases_generator/target_generator.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ def write_opcode_targets(analysis: Analysis, out: CWriter) -> None:
2727
if op < 256:
2828
targets[op] = f"&&TARGET_{name},\n"
2929
out.emit("#if !Py_TAIL_CALL_INTERP\n")
30-
out.emit("static void *opcode_targets[256] = {\n")
30+
out.emit("static void *opcode_targets_table[256] = {\n")
3131
for target in targets:
3232
out.emit(target)
3333
out.emit("};\n")

0 commit comments

Comments
 (0)