Skip to content

Commit aa5f8c2

Browse files
fix build problems
1 parent a61c275 commit aa5f8c2

File tree

2 files changed

+14
-6
lines changed

2 files changed

+14
-6
lines changed

Python/partial_evaluator_bytecodes.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -190,19 +190,21 @@ dummy_func(void) {
190190
ctx->done = true;
191191
}
192192

193-
op(_FOR_ITER_GEN_FRAME, ( -- )) {
193+
op(_FOR_ITER_GEN_FRAME, (iter -- iter, gen_frame)) {
194194
MATERIALIZE_INST();
195+
gen_frame = (_Py_UopsPESlot){NULL, NULL};
195196
/* We are about to hit the end of the trace */
196197
ctx->done = true;
197198
}
198199

199-
op(_SEND_GEN_FRAME, ( -- )) {
200+
op(_SEND_GEN_FRAME, (receiver, v -- receiver, gen_frame)) {
201+
gen_frame = (_Py_UopsPESlot){NULL, NULL};
200202
MATERIALIZE_INST();
201203
// We are about to hit the end of the trace:
202204
ctx->done = true;
203205
}
204206

205-
op(_PUSH_FRAME, (new_frame -- unused if (0))) {
207+
op(_PUSH_FRAME, (new_frame --)) {
206208
MATERIALIZE_INST();
207209
SYNC_SP();
208210
ctx->frame->stack_pointer = stack_pointer;

Python/partial_evaluator_cases.c.h

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -826,11 +826,13 @@
826826
_Py_UopsPESlot v;
827827
_Py_UopsPESlot receiver;
828828
_Py_UopsPESlot gen_frame;
829-
v = stack_pointer[0];
830-
receiver = stack_pointer[1];
829+
v = stack_pointer[-2];
830+
receiver = stack_pointer[-1];
831+
gen_frame = (_Py_UopsPESlot){NULL, NULL};
831832
MATERIALIZE_INST();
832833
// We are about to hit the end of the trace:
833834
ctx->done = true;
835+
stack_pointer[-1] = gen_frame;
834836
break;
835837
}
836838

@@ -2043,10 +2045,14 @@
20432045
case _FOR_ITER_GEN_FRAME: {
20442046
_Py_UopsPESlot iter;
20452047
_Py_UopsPESlot gen_frame;
2046-
iter = stack_pointer[0];
2048+
iter = stack_pointer[-1];
20472049
MATERIALIZE_INST();
2050+
gen_frame = (_Py_UopsPESlot){NULL, NULL};
20482051
/* We are about to hit the end of the trace */
20492052
ctx->done = true;
2053+
stack_pointer[0] = gen_frame;
2054+
stack_pointer += 1;
2055+
assert(WITHIN_STACK_BOUNDS());
20502056
break;
20512057
}
20522058

0 commit comments

Comments
 (0)