summaryrefslogtreecommitdiffstats
path: root/Python/optimizer_bytecodes.c
diff options
context:
space:
mode:
Diffstat (limited to 'Python/optimizer_bytecodes.c')
-rw-r--r--Python/optimizer_bytecodes.c36
1 files changed, 27 insertions, 9 deletions
diff --git a/Python/optimizer_bytecodes.c b/Python/optimizer_bytecodes.c
index 928c22d..aa19a50 100644
--- a/Python/optimizer_bytecodes.c
+++ b/Python/optimizer_bytecodes.c
@@ -85,8 +85,12 @@ dummy_func(void) {
sym_matches_type(right, &PyLong_Type)) {
REPLACE_OP(this_instr, _NOP, 0, 0);
}
- sym_set_type(left, &PyLong_Type);
- sym_set_type(right, &PyLong_Type);
+ if (!sym_set_type(left, &PyLong_Type)) {
+ goto hit_bottom;
+ }
+ if (!sym_set_type(right, &PyLong_Type)) {
+ goto hit_bottom;
+ }
}
op(_GUARD_BOTH_FLOAT, (left, right -- left, right)) {
@@ -94,8 +98,12 @@ dummy_func(void) {
sym_matches_type(right, &PyFloat_Type)) {
REPLACE_OP(this_instr, _NOP, 0 ,0);
}
- sym_set_type(left, &PyFloat_Type);
- sym_set_type(right, &PyFloat_Type);
+ if (!sym_set_type(left, &PyFloat_Type)) {
+ goto hit_bottom;
+ }
+ if (!sym_set_type(right, &PyFloat_Type)) {
+ goto hit_bottom;
+ }
}
op(_GUARD_BOTH_UNICODE, (left, right -- left, right)) {
@@ -103,8 +111,12 @@ dummy_func(void) {
sym_matches_type(right, &PyUnicode_Type)) {
REPLACE_OP(this_instr, _NOP, 0 ,0);
}
- sym_set_type(left, &PyUnicode_Type);
- sym_set_type(right, &PyUnicode_Type);
+ if (!sym_set_type(left, &PyUnicode_Type)) {
+ goto hit_bottom;
+ }
+ if (!sym_set_type(right, &PyUnicode_Type)) {
+ goto hit_bottom;
+ }
}
op(_BINARY_OP_ADD_INT, (left, right -- res)) {
@@ -365,14 +377,20 @@ dummy_func(void) {
op(_CHECK_FUNCTION_EXACT_ARGS, (func_version/2, callable, self_or_null, unused[oparg] -- callable, self_or_null, unused[oparg])) {
- sym_set_type(callable, &PyFunction_Type);
+ if (!sym_set_type(callable, &PyFunction_Type)) {
+ goto hit_bottom;
+ }
(void)self_or_null;
(void)func_version;
}
op(_CHECK_CALL_BOUND_METHOD_EXACT_ARGS, (callable, null, unused[oparg] -- callable, null, unused[oparg])) {
- sym_set_null(null);
- sym_set_type(callable, &PyMethod_Type);
+ if (!sym_set_null(null)) {
+ goto hit_bottom;
+ }
+ if (!sym_set_type(callable, &PyMethod_Type)) {
+ goto hit_bottom;
+ }
}
op(_INIT_CALL_PY_EXACT_ARGS, (callable, self_or_null, args[oparg] -- new_frame: _Py_UOpsAbstractFrame *)) {