Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit52ce698

Browse files
committed
Fix review idea
Signed-off-by: Manjusaka <me@manjusaka.me>
1 parent1662b47 commit52ce698

File tree

2 files changed

+20
-3
lines changed

2 files changed

+20
-3
lines changed

‎Python/optimizer_bytecodes.c

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1088,8 +1088,16 @@ dummy_func(void) {
10881088
res=sym_new_type(ctx,&PyLong_Type);
10891089
}
10901090

1091-
op(_GET_LEN, (--len)) {
1092-
len=sym_new_type(ctx,&PyLong_Type);
1091+
op(_GET_LEN, (obj--obj,len)) {
1092+
inttuple_length=sym_tuple_length(obj);
1093+
if (tuple_length==-1) {
1094+
// Unknown length
1095+
len=sym_new_type(ctx,&PyLong_Type);
1096+
}
1097+
else {
1098+
assert(tuple_length >=0);
1099+
len=sym_new_const(ctx,PyLong_FromLong(tuple_length));
1100+
}
10931101
}
10941102

10951103
op(_GUARD_CALLABLE_LEN, (callable,unused,unused--callable,unused,unused)) {

‎Python/optimizer_cases.c.h

Lines changed: 10 additions & 1 deletion
Some generated files are not rendered by default. Learn more aboutcustomizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp