diff options
Diffstat (limited to 'Python/optimizer_cases.c.h')
-rw-r--r-- | Python/optimizer_cases.c.h | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/Python/optimizer_cases.c.h b/Python/optimizer_cases.c.h index b42f47c75ea..4780e492f61 100644 --- a/Python/optimizer_cases.c.h +++ b/Python/optimizer_cases.c.h @@ -285,8 +285,15 @@ } case _UNARY_INVERT: { + JitOptSymbol *value; JitOptSymbol *res; - res = sym_new_not_null(ctx); + value = stack_pointer[-1]; + if (sym_matches_type(value, &PyLong_Type)) { + res = sym_new_type(ctx, &PyLong_Type); + } + else { + res = sym_new_not_null(ctx); + } stack_pointer[-1] = res; break; } |