v1.1: stabilize static-call lowering and SafeRegAlloc guards#131
Merged
egecanakincioglu merged 4 commits intoJun 8, 2026
Conversation
…ames When parser generates CTOR for IDENT(), check if class is registered. If not and current class context exists, fall back to static method call on current class (e.g., foo() → T.foo() instead of foo__init). Fixes foo__init unresolved label for static method calls.
SafeRegAlloc.arm: - Add errorCode field (0=ok, 1=unknown slot, 2=unwritten slot) - slotOffsetByName returns safe sentinel -(slotCnt+100)*8 for unknown names - assertKnown/assertWritten set errorCode instead of only printing IRToX64.arm: - safeLoadVal/safeStoreDst set errorCode=3 when offset=0 (offset 0 maps to saved RBP, corrupting frame chain)
…ed static calls Parser always generates METHOD_CALL for X.method(), cannot distinguish class names from object references. The classIdxOf redirect in lowerMethodCall resolves ClassName.method() to static calls. Guard: varLookup(obj.strVal) == '' ensures variable names are never redirected (prevents the original overbroad-redirect bug).
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Four atomic commits fixing static method call routing and hardening SafeRegAlloc against slot corruption.
Atomic Commits
db89158 —
fix(ir): restore clean IRLower self-host safe-regalloc patchesc785cd7 —
fix(ir): CTOR fallback to static method call for unregistered class namesIDENT(). When class not registered, fall back to static method call on current class.foo()generatingfoo__initinstead ofT__foo4116e64 —
fix(regalloc): reject unknown spill slots and frame offset zerod4ea690 —
fix(ir): restore classIdxOf redirect with varLookup guard for qualified static callsClassName.method()to static calls without false-positive variable redirectsValidation
All tests compiled with
--target linux --safe-regalloc:Bootstrap: S1 Rust compiler builds current source → 295K dynamic S3.
Known Remaining Blockers
File.read/File.write/Process.execimplementationRules
🤖 Generated with Claude Code