[erlang-questions] infinite loop in merl_tranform

Richard Carlsson <>
Fri Jul 8 10:48:19 CEST 2016


Thanks for the report. Definitely sounds like a bug. I'm on vacation right
now, but will look at it as soon as I can.
Den 6 jul 2016 22:50 skrev "Peti Gömöri" <>:

Hello,

While being knee deep in metaprogramming with merl (OTP 18.3) I made a
small typo which led the compilation of my module into an infinite loop.

I managed to shrink it down to a module like this

    -module(infinity).
    -export([f/1]).
    -include_lib("syntax_tools/include/merl.hrl").
    f(V) -> merl:qquote("@var", [{var, V}]).

( or this oneliner call
    Form = merl:quote("f(V) -> merl:qquote(\"@var\", [{var, V}])."),
merl_transform:parse_transform([Form], []).
)

Seems to me that the optimisation to create templates at compile time in
merl_transform:expand_qquote is tricked.

Can this be considered a bug? I would expect either a compilation error or
just silently creating a module which will throw at runtime.


thanks
Peter

_______________________________________________
erlang-questions mailing list

http://erlang.org/mailman/listinfo/erlang-questions
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20160708/438b8d04/attachment.html>


More information about the erlang-questions mailing list