FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

gh-132732: Clear errors in JIT optimizer on error by Fidget-Spinner · Pull Request #136048 · python/cpython · GitHub

Repository navigation

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension .c  (1) All 1 file type selected
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
13 changes: 10 additions & 3 deletions Python/optimizer_analysis.c
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -462,7 +462,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. */
/* >0 (length) for success, 0 for not ready, clears all possible errors. */
static int
optimize_uops(
PyCodeObject *co,
Expand All @@ -472,6 +472,7 @@ optimize_uops(
_PyBloomFilter *dependencies
)
{
assert(!PyErr_Occurred());

JitOptContext context;
JitOptContext *ctx = &context;
Expand Down Expand Up @@ -555,7 +556,11 @@ optimize_uops(
OPT_ERROR_IN_OPCODE(opcode);
}
_Py_uop_abstractcontext_fini(ctx);
return -1;

assert(PyErr_Occurred());
PyErr_Clear();

return 0;

}

Expand Down Expand Up @@ -702,10 +707,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);

Expand Down
Loading

Back | FazBrowse Home | New Git URL