cmpltv: don't raise from print-object on a half-built creator - #1827
Open
dg1sbg wants to merge 1 commit into
Open
cmpltv: don't raise from print-object on a half-built creator#1827dg1sbg wants to merge 1 commit into
dg1sbg wants to merge 1 commit into
Conversation
Contributor
Author
|
Note on the two CI reds — both are the same known flake, and neither relates to this change.
This PR touches only
|
print-object for vcreator guards %prototype with slot-boundp but reads
(index object) unguarded, and the creator method reads it unguarded
too. A creator whose index has not been assigned therefore signals an
unbound-slot error from inside the printer, which replaces whatever
condition was actually being reported and splices the new message into
the middle of the old one:
#<CMPLTV::BASE-STRING-CREATOR [no prototype]The slot CMPLTV::%INDEX
is unbound in an instance of CMPLTV::BASE-STRING-CREATOR.
Guard both reads the way %prototype already is.
Also widen the %index slot type to (or null (integer 0)), matching
Maclina. The slot's initform is nil, which the declared (integer 0)
excludes; nothing enforces it today, but the declaration contradicts
the initform.
dg1sbg
force-pushed
the
fix/cmpltv-print-object-guard
branch
from
August 13, 2026 16:35
c260817 to
f7c25c5
Compare
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.
Two small robustness changes in
src/lisp/kernel/cmp/cmpltv.lisp. Neither fixes a bug I can currently demonstrate; both were found while chasing a failure whose real cause the first one was actively hiding.print-objectcan raise and swallow the condition it was printingprint-objectforvcreatoralready guards%prototypewithslot-boundp, but reads(index object)unguarded three lines later — and thecreatormethod reads it unguarded too. A creator whose index has not yet been assigned therefore signals an unbound-slot error from inside the printer, which replaces whatever condition was actually being reported and splices the new message into the middle of the old one:That is what the failure I was investigating looked like, and it cost real time — the visible error is entirely about the printer, while the original condition is gone. This guards both reads the way
%prototypealready is, so such an object prints as[no index]and the real condition survives.%indextype contradicts its own initformThe slot is declared
:type (integer 0)with:initform nil, which the type excludes. Upstream Maclina has:type (or null (integer 0))for the same slot; this looks like drift. Nothing enforces it today — I checked,make-instancestoresnilthere without complaint — so this is tidiness rather than a fix, but the declaration should not contradict the initform.Verification
x86-64 Linux, LLVM 18,
--build-mode=bytecode: builds clean, regression suite 1963 successes /TEST_EXIT=0, identical to baseline.