Subject: Re: bug#7146: (make-symbol "") issues

From: Frank <[email-masked]>
Date: Sat, 02 Oct 2010 21:44:00 -0600

Chong Yidong schrieb:

>Frank <[email-masked]> writes:
>
>  
>
>>Well I further found out that you have to actually (byte-compile-file)
>>the above code in order for the bug to show up; compiling via
>>(compile-defun) seems to work OK;
>>    
>>
>
>I can't reproduce this.  Could you detail the *exact* steps you took,
>starting with `emacs -Q'?  Your description is too vague.
>
>  
>
1) Start `emacs -Q'
2) Load the file bug.el into a buffer via the menu
3) <M-x> byte-compile-file
4) <M-x> load-file bug.elc
5) <C-x b> *scratch*
6) (foo) *** emacs crashes or foo returns some odd number ***

(disassemble 'foo) looks like this (done between point 5 and 6)

byte code for foo:
  args: nil
0    constant  (message "Hello World!")
1    constant  (out-of-range 2)
2    catch     
3    dup     
4    varbind      :eof
5    constant  (message "Hello World!")
6    eq     
7    not     
8    goto-if-nil-else-pop 1
11    varref      :eof
12:1    unbind      1
13    return     

I attached the file I used for testing this and also it's byte compilation

(defmacro bar (&rest body)
 (let ((v (make-symbol "")))         ; Crashes with "" as name.
   `(let ((,v (catch :eof
        ,@body)))

      (when (not (eq ,v :eof))
    ,v))))

(defun foo ()
 (bar (message "Hello World!")))