Wrong return types leak into type inference

Bug #1924619 reported by White Flame
This bug report is a duplicate of:  Bug #1824351: full call to SB-VM::%LOGBITP. Edit Remove
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
SBCL
New
Undecided
Unassigned

Bug Description

I have a SYNTAX-ERROR function in a LABELS body which generates a richer error message and always leaves by calling ERROR, so its return type should be NIL.

But when this is called in other functions, the return type of the _outer_ functions seem to sometimes get added to the inferred return type of SYNTAX-ERROR as well. Style warnings pop out about its return value, and the compiler generates a full call expecting a return.

An extracted error case is attached.

The code executes properly, but the warnings & codegen aren't right.

I found this in my git source builds, including with no .sbclrc or SLIME:
 2.1.3.50-e8b780650
 2.1.3.83-7328e9955

From IRC, reproducibility might be involved in compiler policy, and this might be old:
 <Krystof> White_Flame: funny that people didn't reproduce; I get the same in 1.4.16.debian
 <scymtym> i can reproduce it with default and "fast", but not "safe" policy

It seems like the position of the IF in particular to returning possible values for its function might be related. Deeper nested usages of SYNTAX-ERROR in other functions don't cause this info leak.

Linux wfdis 5.4.0-70-generic #78~18.04.1-Ubuntu SMP Sat Mar 20 14:10:07 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux

(:DECLARE-TYPES :QUICKLISP :ASDF3.3 :ASDF3.2 :ASDF3.1 :ASDF3 :ASDF2 :ASDF
 :OS-UNIX :NON-BASE-CHARS-EXIST-P :ASDF-UNICODE :X86-64 :GENCGC :64-BIT
 :ANSI-CL :COMMON-LISP :ELF :IEEE-FLOATING-POINT :LINUX :LITTLE-ENDIAN
 :PACKAGE-LOCAL-NICKNAMES :SB-CORE-COMPRESSION :SB-LDB :SB-PACKAGE-LOCKS
 :SB-THREAD :SB-UNICODE :SBCL :UNIX)

Revision history for this message
White Flame (white-flame) wrote :
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.