Skip to content

Commit 3e6fe60

Browse files
fix optimizer
1 parent d86cd72 commit 3e6fe60

File tree

2 files changed

+26
-6
lines changed

2 files changed

+26
-6
lines changed

Python/optimizer_bytecodes.c

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1069,18 +1069,28 @@ dummy_func(void) {
10691069
c = callable;
10701070
if (sym_is_not_null(self_or_null)) {
10711071
args--;
1072+
s = args[0];
1073+
}
1074+
else if (sym_is_null(self_or_null)) {
1075+
s = args[0];
1076+
}
1077+
else {
1078+
s = sym_new_unknown(ctx);
10721079
}
1073-
s = args[0];
10741080
}
10751081

10761082
op(_CALL_METHOD_DESCRIPTOR_O, (callable, self_or_null, args[oparg] -- res, c, s, a)) {
10771083
res = sym_new_not_null(ctx);
10781084
c = callable;
10791085
if (sym_is_not_null(self_or_null)) {
10801086
args--;
1087+
s = args[0];
1088+
a = args[1];
1089+
}
1090+
else {
1091+
s = sym_new_unknown(ctx);
1092+
a = sym_new_unknown(ctx);
10811093
}
1082-
s = args[0];
1083-
a = args[1];
10841094
}
10851095

10861096
op(_GUARD_IS_FALSE_POP, (flag -- )) {

Python/optimizer_cases.c.h

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

0 commit comments

Comments
 (0)