Repository navigation
Rename locals away from every head the back end emits bare - #1371
Merged
Merged
Conversation
The restore around a non-tail call emits pair?, virtual-register and set-virtual-register! bare, and none of them was in rt-emitted-names, so a local with one of those names shadowed it: honeysql's (let [pair? ...]) made the restore call its boolean, 41 library-gate errors. They join the names a colliding local is renamed away from. Reminted.
A local named fx+, fx- or fx> broke any try/finally in its scope: the fiber mask the finally lowers to calls them bare. A scan of the emitter's string literals found about fifty such heads missing from rt-emitted-names, Scheme procedures and runtime helpers alike. They are all listed now, and the new emittedheads gate repeats the scan so a new emission site can't drift past the list again.
… after emitted heads 0.8.21 fails to build a program that defines vector or fx+: the def is a Scheme define in the app unit and shadows the record ctor's (vector ...) and the finally's (fx+ ...).
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.
The new site-restore emits a bare pair?, and honeysql binds a local named pair?, so the restore called a boolean (41 libconformance errors). virtual-register and set-virtual-register! had the same gap.
Looking for others turned up about fifty more heads written into the output text but missing from rt-emitted-names. One predates this release: a local named fx+, fx- or fx> breaks any try/finally in its scope, because the finally's fiber mask calls them bare (0.8.21 has it too). The rest are Scheme procedures (car, cons, vector, not, string-append...) and runtime helpers at PIC, record, ffi, def and image sites. All of them are on the list now.
The list is only kept by hand, so the new emittedheads gate (in ci) reads backend_scheme.clj's string literals, collects every emitted head, and fails on any that munge-name leaves bare, except a short allowlist of prose and binders whose scope holds no user code. It reports 50 failures against main. Corpus rows cover both cases.