Prevent symbol table exhaustion during codegen#6670
Conversation
|
Important Review skippedBot user detected. To trigger a single review, invoke the You can disable this status message by setting the Comment |
Co-authored-by: youknowone <69878+youknowone@users.noreply.github.com>
Co-authored-by: youknowone <69878+youknowone@users.noreply.github.com>
|
@copilot That's a meaningful enhancement, but doesn't fix the fundamental problem. Could you investigate more what caused that error and fix the fundamental problem? |
Co-authored-by: youknowone <69878+youknowone@users.noreply.github.com>
Root cause was that we consumed and removed sub-tables, so double-compilation paths (e.g., try/finally) could exhaust the cursor and leave no tables for later scopes. I switched to tracking a per-table cursor and resetting it when recompiling paths, so we reuse the same symbol tables instead of removing them (commit 5121b75). |
|
Code has been automatically formatted The code in this PR has been formatted using git pull origin copilot/fix-panic-in-compile-rs |
* Handle missing symbol table without panic * Update symbol table error message * Track symbol table cursors to avoid exhaustion --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: youknowone <69878+youknowone@users.noreply.github.com> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
The compiler panicked on
push_symbol_tablewhen compiling xonsh/pytest hooks, crashing the run.push_symbol_tablenow returns a codegen error if no subtable is available, rather than panicking.Example (simplified):
Original prompt
This section details on the original issue you should resolve
<issue_title>thread 'main' panicked at crates/codegen/src/compile.rs:648:13:</issue_title>
<issue_description>```xsh
rustpython -V
Python 3.13.0alpha (heads/master:8bfe927de