-
-
Notifications
You must be signed in to change notification settings - Fork 34.5k
gh-132732: Clear errors in JIT optimizer on error #136048
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 3 commits
267ecf7
34c3f2b
4eb9781
412ec63
26e2978
87505e1
2f256d4
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -461,7 +461,7 @@ const uint16_t op_without_decref_inputs[MAX_UOP_ID + 1] = { | |||||||||||
| [_BINARY_OP_SUBTRACT_FLOAT] = _BINARY_OP_SUBTRACT_FLOAT__NO_DECREF_INPUTS, | ||||||||||||
| }; | ||||||||||||
|
|
||||||||||||
| /* 1 for success, 0 for not ready, cannot error at the moment. */ | ||||||||||||
| /* 1 for success, 0 for not ready, clears all possible errors. */ | ||||||||||||
| static int | ||||||||||||
| optimize_uops( | ||||||||||||
| PyCodeObject *co, | ||||||||||||
|
|
@@ -471,6 +471,7 @@ optimize_uops( | |||||||||||
| _PyBloomFilter *dependencies | ||||||||||||
| ) | ||||||||||||
| { | ||||||||||||
| assert(!PyErr_Occurred()); | ||||||||||||
|
|
||||||||||||
| JitOptContext context; | ||||||||||||
| JitOptContext *ctx = &context; | ||||||||||||
|
|
@@ -483,7 +484,7 @@ optimize_uops( | |||||||||||
| _Py_uop_abstractcontext_init(ctx); | ||||||||||||
| _Py_UOpsAbstractFrame *frame = _Py_uop_frame_new(ctx, co, curr_stacklen, NULL, 0); | ||||||||||||
| if (frame == NULL) { | ||||||||||||
| return -1; | ||||||||||||
| return 0; | ||||||||||||
| } | ||||||||||||
| ctx->curr_frame_depth++; | ||||||||||||
| ctx->frame = frame; | ||||||||||||
|
|
@@ -557,7 +558,11 @@ optimize_uops( | |||||||||||
| OPT_ERROR_IN_OPCODE(opcode); | ||||||||||||
| } | ||||||||||||
| _Py_uop_abstractcontext_fini(ctx); | ||||||||||||
| return -1; | ||||||||||||
|
|
||||||||||||
| if (PyErr_Occurred()) { | ||||||||||||
| PyErr_Clear(); | ||||||||||||
| } | ||||||||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Shouldn't this be:
Suggested change
...or are there cases where an error hasn't occurred, but we end up here?
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think the current code goes to error on some cases where we run out of memory too, but no memoryerror is set.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't think so, all uses of |
||||||||||||
| return 0; | ||||||||||||
|
|
||||||||||||
| } | ||||||||||||
|
|
||||||||||||
|
|
@@ -704,10 +709,12 @@ _Py_uop_analyze_and_optimize( | |||||||||||
| _PyFrame_GetCode(frame), buffer, | ||||||||||||
| length, curr_stacklen, dependencies); | ||||||||||||
|
|
||||||||||||
| if (length <= 0) { | ||||||||||||
| if (length == 0) { | ||||||||||||
| return length; | ||||||||||||
| } | ||||||||||||
|
|
||||||||||||
| assert(length > 0); | ||||||||||||
|
|
||||||||||||
| length = remove_unneeded_uops(buffer, length); | ||||||||||||
| assert(length > 0); | ||||||||||||
|
|
||||||||||||
|
|
||||||||||||
Uh oh!
There was an error while loading. Please reload this page.