Skip to content

Commit 05a4daa

Browse files
committed
Fix RETURN_VALUE in optimizer
1 parent 417c96d commit 05a4daa

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

Python/optimizer_bytecodes.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -717,6 +717,8 @@ dummy_func(void) {
717717
}
718718

719719
op(_RETURN_VALUE, (retval -- res)) {
720+
JitOptSymbol *temp = retval;
721+
DEAD(retval);
720722
SAVE_STACK();
721723
ctx->frame->stack_pointer = stack_pointer;
722724
frame_pop(ctx);
@@ -736,7 +738,7 @@ dummy_func(void) {
736738
ctx->done = true;
737739
}
738740
RELOAD_STACK();
739-
res = retval;
741+
res = temp;
740742
}
741743

742744
op(_RETURN_GENERATOR, ( -- res)) {

Python/optimizer_cases.c.h

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

0 commit comments

Comments
 (0)