Skip to content

Commit cc5bf06

Browse files
check for overflow
1 parent 53f2396 commit cc5bf06

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

Python/optimizer_bytecodes.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -562,7 +562,9 @@ dummy_func(void) {
562562
(void)self_or_null;
563563
if (sym_is_const(callable) && sym_matches_type(callable, &PyFunction_Type)) {
564564
assert(PyFunction_Check(sym_get_const(callable)));
565-
REPLACE_OP(this_instr, _CHECK_FUNCTION_VERSION_INLINE, func_version, (uintptr_t)sym_get_const(callable));
565+
if (func_version == (uint16_t)func_version) {
566+
REPLACE_OP(this_instr, _CHECK_FUNCTION_VERSION_INLINE, func_version, (uintptr_t)sym_get_const(callable));
567+
}
566568
}
567569
sym_set_type(callable, &PyFunction_Type);
568570
}

Python/optimizer_cases.c.h

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

0 commit comments

Comments
 (0)