Skip to content

Commit 1201f7c

Browse files
Use sym_matches_type PyFunction_Type
1 parent f0733d9 commit 1201f7c

File tree

3 files changed

+3
-5
lines changed

3 files changed

+3
-5
lines changed

Python/ceval_macros.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -409,7 +409,7 @@ do { \
409409

410410
#define CURRENT_OPARG() (next_uop[-1].oparg)
411411

412-
#define CURRENT_OPERAND() (next_uop[-1].operand)
412+
#define CURRENT_OPERAND0() (next_uop[-1].operand0)
413413
#define CURRENT_OPERAND1() (next_uop[-1].operand1)
414414

415415
#define JUMP_TO_JUMP_TARGET() goto jump_to_jump_target

Python/optimizer_bytecodes.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -600,13 +600,12 @@ dummy_func(void) {
600600
}
601601

602602
op(_CHECK_FUNCTION_EXACT_ARGS, (callable, self_or_null, unused[oparg] -- callable, self_or_null, unused[oparg])) {
603-
assert((this_instr-1)->opcode == _CHECK_FUNCTION_VERSION || (this_instr-1)->opcode == _CHECK_FUNCTION_VERSION_INLINE);
603+
assert(sym_matches_type(callable, &PyFunction_Type));
604604
if (sym_is_const(callable) && sym_matches_type(callable, &PyFunction_Type)) {
605605
if (sym_is_null(self_or_null) || sym_is_not_null(self_or_null)) {
606606
PyFunctionObject *func = (PyFunctionObject *)sym_get_const(callable);
607607
PyCodeObject *co = (PyCodeObject *)func->func_code;
608608
if (co->co_argcount == oparg + !sym_is_null(self_or_null)) {
609-
// Note: this is only valid if CHECK_FUNCTION_VERSION precedes this instruction.
610609
REPLACE_OP(this_instr, _NOP, 0 ,0);
611610
}
612611
}

Python/optimizer_cases.c.h

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

0 commit comments

Comments
 (0)