mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
gh-116088: Insert bottom checks after all sym_set_...() calls (#116089)
This changes the `sym_set_...()` functions to return a `bool` which is `false` when the symbol is `bottom` after the operation. All calls to such functions now check this result and go to `hit_bottom`, a special error label that prints a different message and then reports that it wasn't able to optimize the trace. No executor will be produced in this case.
This commit is contained in:
parent
3b6f4cadf1
commit
0656509033
7 changed files with 106 additions and 47 deletions
|
@ -363,6 +363,15 @@ error:
|
|||
DPRINTF(1, "Encountered error in abstract interpreter\n");
|
||||
_Py_uop_abstractcontext_fini(ctx);
|
||||
return 0;
|
||||
|
||||
hit_bottom:
|
||||
// Attempted to push a "bottom" (contradition) symbol onto the stack.
|
||||
// This means that the abstract interpreter has hit unreachable code.
|
||||
// We *could* generate an _EXIT_TRACE or _FATAL_ERROR here, but it's
|
||||
// simpler to just admit failure and not create the executor.
|
||||
DPRINTF(1, "Hit bottom in abstract interpreter\n");
|
||||
_Py_uop_abstractcontext_fini(ctx);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue