Skip to content

Commit de53184

Browse files
committed
better type-check
1 parent ab7c1c7 commit de53184

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Python/optimizer_bytecodes.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -468,7 +468,8 @@ dummy_func(void) {
468468
}
469469

470470
op(_UNARY_INVERT, (value -- res)) {
471-
if (sym_matches_type(value, &PyLong_Type) || sym_matches_type(value, &PyBool_Type)) {
471+
PyTypeObject *type = sym_get_type(value);
472+
if (type == &PyLong_Type || type == &PyBool_Type) {
472473
res = sym_new_type(ctx, &PyLong_Type);
473474
}
474475
else {

0 commit comments

Comments
 (0)