summaryrefslogtreecommitdiffstats
path: root/Python/optimizer_cases.c.h
diff options
context:
space:
mode:
Diffstat (limited to 'Python/optimizer_cases.c.h')
-rw-r--r--Python/optimizer_cases.c.h25
1 files changed, 18 insertions, 7 deletions
diff --git a/Python/optimizer_cases.c.h b/Python/optimizer_cases.c.h
index a0ecf58..2908a26 100644
--- a/Python/optimizer_cases.c.h
+++ b/Python/optimizer_cases.c.h
@@ -1596,14 +1596,25 @@
callable = stack_pointer[-2 - oparg];
int argcount = oparg;
(void)callable;
- PyFunctionObject *func = (PyFunctionObject *)(this_instr + 2)->operand;
- DPRINTF(3, "func: %p ", func);
- if (func == NULL) {
- DPRINTF(3, "\n");
- DPRINTF(1, "Missing function\n");
- goto done;
+ PyCodeObject *co = NULL;
+ assert((this_instr + 2)->opcode == _PUSH_FRAME);
+ uintptr_t push_operand = (this_instr + 2)->operand;
+ if (push_operand & 1) {
+ co = (PyCodeObject *)(push_operand & ~1);
+ DPRINTF(3, "code=%p ", co);
+ assert(PyCode_Check(co));
+ }
+ else {
+ PyFunctionObject *func = (PyFunctionObject *)push_operand;
+ DPRINTF(3, "func=%p ", func);
+ if (func == NULL) {
+ DPRINTF(3, "\n");
+ DPRINTF(1, "Missing function\n");
+ goto done;
+ }
+ co = (PyCodeObject *)func->func_code;
+ DPRINTF(3, "code=%p ", co);
}
- PyCodeObject *co = (PyCodeObject *)func->func_code;
assert(self_or_null != NULL);
assert(args != NULL);
if (sym_is_not_null(self_or_null)) {