mirror of
https://github.com/python/cpython.git
synced 2025-11-01 06:01:29 +00:00
gh-137728 gh-137762: Fix bugs in the JIT with many local variables (GH-137764)
This commit is contained in:
parent
eae9d7de1c
commit
7fda8b66de
3 changed files with 9 additions and 4 deletions
|
|
@ -0,0 +1 @@
|
||||||
|
Fix the JIT's handling of many local variables. This previously caused a segfault.
|
||||||
|
|
@ -484,13 +484,10 @@ optimize_uops(
|
||||||
_Py_uop_abstractcontext_init(ctx);
|
_Py_uop_abstractcontext_init(ctx);
|
||||||
_Py_UOpsAbstractFrame *frame = _Py_uop_frame_new(ctx, co, curr_stacklen, NULL, 0);
|
_Py_UOpsAbstractFrame *frame = _Py_uop_frame_new(ctx, co, curr_stacklen, NULL, 0);
|
||||||
if (frame == NULL) {
|
if (frame == NULL) {
|
||||||
return -1;
|
return 0;
|
||||||
}
|
}
|
||||||
ctx->curr_frame_depth++;
|
ctx->curr_frame_depth++;
|
||||||
ctx->frame = frame;
|
ctx->frame = frame;
|
||||||
ctx->done = false;
|
|
||||||
ctx->out_of_space = false;
|
|
||||||
ctx->contradiction = false;
|
|
||||||
|
|
||||||
_PyUOpInstruction *this_instr = NULL;
|
_PyUOpInstruction *this_instr = NULL;
|
||||||
for (int i = 0; !ctx->done; i++) {
|
for (int i = 0; !ctx->done; i++) {
|
||||||
|
|
|
||||||
|
|
@ -888,6 +888,13 @@ _Py_uop_abstractcontext_init(JitOptContext *ctx)
|
||||||
|
|
||||||
// Frame setup
|
// Frame setup
|
||||||
ctx->curr_frame_depth = 0;
|
ctx->curr_frame_depth = 0;
|
||||||
|
|
||||||
|
// Ctx signals.
|
||||||
|
// Note: this must happen before frame_new, as it might override
|
||||||
|
// the result should frame_new set things to bottom.
|
||||||
|
ctx->done = false;
|
||||||
|
ctx->out_of_space = false;
|
||||||
|
ctx->contradiction = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue