• mevenson@1c010e3e-69d0-11dd-93a8-456734b0d56f's avatar
    Fix signalling simple error with #\~ in format string · 6a866834
    (Alan Ruttenberg)
    
    Signaling an simple error would signal another error if the message
    happened to have a ~ in it, since in simple cases there are no format
    args, but format is called with the message string.
    
    We fix this by changing all cases in the source where there were calls
    to setFormatControl(x) are followed by setFormatArguments(NIL). In
    such cases we changed setFormatControl(x) ->
    setFormatControl(x.replaceAll("~","~~")), which is the CL:FORMAT
    recipe for escaping a #\~ character.
    
    To replicate this error, place the following in a file
    <file:~/work/abcl/double-error.lisp>.
    
        (defun foo (x) (funcall x))
    
    then
    
        CL-USER> (compile-file "~/work/abcl/double-error")
        ; Compiling /Users/evenson/work/abcl/double-error.lisp ...
        ; (DEFUN FOO ...)
        ; Wrote /Users/evenson/work/abcl/double-error.abcl (0.015 seconds)
        #P"/Users/evenson/work/abcl/double-error.abcl"
        NIL
        NIL
        CL-USER> (foo '~)
    
    gives
    
        Error (FORMAT-ERROR) during printing: #<PROGRAM-ERROR {264F63C5}>
           [Condition of type PROGRAM-ERROR]
    
    Merges <https://github.com/armedbear/abcl/pull/41>.
    6a866834
Name
Last commit
Last update
contrib Loading commit data...
doc Loading commit data...
examples Loading commit data...
nbproject Loading commit data...
patches Loading commit data...
src Loading commit data...
t Loading commit data...
test Loading commit data...
tools Loading commit data...
.dir-locals.el Loading commit data...
.gitignore Loading commit data...
.hgignore Loading commit data...
CHANGES Loading commit data...
COPYING Loading commit data...
Dockerfile Loading commit data...
MANUAL Loading commit data...
README Loading commit data...
abcl.asd Loading commit data...
abcl.bat.in Loading commit data...
abcl.in Loading commit data...
abcl.properties.in Loading commit data...
abcl.rdf Loading commit data...
build-from-lisp.bash Loading commit data...
build-maven.xml Loading commit data...
build-snapshot.xml Loading commit data...
build.xml Loading commit data...
install-sh Loading commit data...
make-jar.bat.in Loading commit data...
make-jar.in Loading commit data...
maven-release.txt Loading commit data...
netbeans-build.xml Loading commit data...
pom.xml Loading commit data...