summaryrefslogtreecommitdiffstats
path: root/Python/specialize.c
diff options
context:
space:
mode:
Diffstat (limited to 'Python/specialize.c')
-rw-r--r--Python/specialize.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/Python/specialize.c b/Python/specialize.c
index d8bff39..4b33a46 100644
--- a/Python/specialize.c
+++ b/Python/specialize.c
@@ -1599,7 +1599,7 @@ function_get_version(PyObject *o, int opcode)
assert(Py_IS_TYPE(o, &PyFunction_Type));
PyFunctionObject *func = (PyFunctionObject *)o;
uint32_t version = _PyFunction_GetVersionForCurrentState(func);
- if (version == 0) {
+ if (!_PyFunction_IsVersionValid(version)) {
SPECIALIZATION_FAIL(opcode, SPEC_FAIL_OUT_OF_VERSIONS);
return 0;
}
@@ -1692,7 +1692,7 @@ _Py_Specialize_BinarySubscr(
goto fail;
}
uint32_t version = _PyFunction_GetVersionForCurrentState(func);
- if (version == 0) {
+ if (!_PyFunction_IsVersionValid(version)) {
SPECIALIZATION_FAIL(BINARY_SUBSCR, SPEC_FAIL_OUT_OF_VERSIONS);
goto fail;
}
@@ -1977,7 +1977,7 @@ specialize_py_call(PyFunctionObject *func, _Py_CODEUNIT *instr, int nargs,
argcount = code->co_argcount;
}
int version = _PyFunction_GetVersionForCurrentState(func);
- if (version == 0) {
+ if (!_PyFunction_IsVersionValid(version)) {
SPECIALIZATION_FAIL(CALL, SPEC_FAIL_OUT_OF_VERSIONS);
return -1;
}
@@ -2009,7 +2009,7 @@ specialize_py_call_kw(PyFunctionObject *func, _Py_CODEUNIT *instr, int nargs,
return -1;
}
int version = _PyFunction_GetVersionForCurrentState(func);
- if (version == 0) {
+ if (!_PyFunction_IsVersionValid(version)) {
SPECIALIZATION_FAIL(CALL, SPEC_FAIL_OUT_OF_VERSIONS);
return -1;
}