[erlang-bugs] erl_pp bug in r11b-2?

Ulf Wiger <>
Thu Nov 23 22:03:15 CET 2006


When I switched from R11B to R11B-2 on my Ubuntu, I started getting
strange syntax errors in a file generated by leex.

The .xrl file, as well as the leex.[eh]rl files used are at
http://erlhive.svn.sourceforge.net/viewvc/erlhive/lib/erlhive/src/

After some tracing, I decided that the bug seems to be in erl_pp.erl. I
cut out the call to erl_pp that I picked up from tracing on leex, and ran
it in both R11 (stdlib-1.14.1) and R11B-2 (stdlib-1.14.2). Results follow:

:~/dev/leex_bug$ ~/lib/otp/r11b-2/bin/erl
Erlang (BEAM) emulator version 5.5.2 [source] [async-threads:0] [hipe]
[kernel-poll:false]

Eshell V5.5.2  (abort with ^G)
1> io:format("~s~n",
[erl_pp:exprs([{match,14,{var,14,'Atom'},{call,14,{atom,14,list_to_atom},[{var,14,'YYtext'}]}},{tuple,15,[{atom,15,token},{'case',15,{call,15,{atom,15,reserved_word},[{var,15,'Atom'}]},[{clause,16,[{atom,16,true}],[],[{tuple,16,[{var,16,'Atom'},{var,16,'YYline'}]}]},{clause,17,[{atom,17,false}],[],[{tuple,17,[{atom,17,atom},{var,17,'YYline'},
{var,17,'Atom'}]}]}]}]}],4,none)]).
Atom = list_to_atom(YYtext){token,
     case reserved_word(Atom) of
         true -> {Atom,YYline}; false -> {atom,YYline,Atom}
     end}
ok
2>
BREAK: (a)bort (c)ontinue (p)roc info (i)nfo (l)oaded
       (v)ersion (k)ill (D)b-tables (d)istribution
a
:~/dev/leex_bug$ ~/lib/otp/r11b/bin/erl
Erlang (BEAM) emulator version 5.5.1 [source] [async-threads:0] [hipe]

Eshell V5.5.1  (abort with ^G)
1> io:format("~s~n",
[erl_pp:exprs([{match,14,{var,14,'Atom'},{call,14,{atom,14,list_to_atom},[{var,14,'YYtext'}]}},{tuple,15,[{atom,15,token},{'case',15,{call,15,{atom,15,reserved_word},[{var,15,'Atom'}]},[{clause,16,[{atom,16,true}],[],[{tuple,16,[{var,16,'Atom'},{var,16,'YYline'}]}]},{clause,17,[{atom,17,false}],[],[{tuple,17,[{atom,17,atom},{var,17,'YYline'},
{var,17,'Atom'}]}]}]}]}],4,none)]).
Atom = list_to_atom(YYtext),
    {token,
     case reserved_word(Atom) of
         true ->
             {Atom,YYline};
         false ->
             {atom,YYline,Atom}
     end}
ok


My debugging ended with running a diff on erl_pp between stdlib-1.4.1 and
stdlib-1.4.2, but the module seems to have been quite heavily modified.

BR,
Ulf W




More information about the erlang-bugs mailing list