Erlang/OTP Forums

Author Message

<  Erlang bugs mailing list  ~  erl_pp bug in r11b-2?

uffe
Posted: Thu Nov 23, 2006 9:05 pm Reply with quote
User Joined: 02 Mar 2005 Posts: 365 Location: Sweden
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:

uwiger@labpc8195:~/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
uwiger@labpc8195:~/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

_______________________________________________
erlang-bugs mailing list
erlang-bugs@erlang.org
http://www.erlang.org/mailman/listinfo/erlang-bugs
Post recived from mailinglist
View user's profile Send private message Visit poster's website
Guest
Posted: Fri Nov 24, 2006 8:11 am Reply with quote
Guest
[Ulf Wiger:]
> After some tracing, I decided that the bug seems to be in erl_pp.erl.

Thanks for taking the time to investigate this problem.

The bug has been fixed in patch erl_891_otp_beam.

What follows is a diff for those who haven't got access to the
Erlang/OTP Licensees' Area:


*** stdlib/src/erl_pp.erl Mon Nov 6 14:52:04 2006
--- erl_pp.erl Tue Nov 14 15:27:43 2006
***************
*** 81,87 ****
exprs(Es, 0, Hook).

exprs(Es, I, Hook) ->
! map(fun(Item) -> frmt(Item, I) end, lexprs(Es, Hook)).

expr(E) ->
frmt(lexpr(E, 0, none)).
--- 81,87 ----
exprs(Es, 0, Hook).

exprs(Es, I, Hook) ->
! frmt({seq,[],[],[$,],lexprs(Es, Hook)}, I).

expr(E) ->
frmt(lexpr(E, 0, none)).


Best regards,

Hans Bolinder, Erlang/OTP
_______________________________________________
erlang-bugs mailing list
erlang-bugs@erlang.org
http://www.erlang.org/mailman/listinfo/erlang-bugs
Post recived from mailinglist

Display posts from previous:  

All times are GMT
Page 1 of 1
This forum is locked: you cannot post, reply to, or edit topics.

Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum