[erlang-bugs] compiler bug with funs

Simon Cornish zl9d97p02@REDACTED
Sun Jan 13 09:20:59 CET 2008


The attached Erlang code demonstrates a bug with funs.
Compile and evaluate broken_fun:die(a) or  broken_fun:die({b,c})
for two different failure modes.

It seems to me that the live register check for call_fun is off by
one. Attached also a suggested patch. If I actually understood the
compiler, I'd post this to erlang-patches, but since I don't someone
else can check to see whether this is the right fix :-)

Simon
-------------- next part --------------
A non-text attachment was scrubbed...
Name: broken_fun.erl
Type: application/octet-stream
Size: 233 bytes
Desc: not available
URL: <http://erlang.org/pipermail/erlang-bugs/attachments/20080113/1aea8a96/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: beam_utils.patch
Type: application/octet-stream
Size: 621 bytes
Desc: not available
URL: <http://erlang.org/pipermail/erlang-bugs/attachments/20080113/1aea8a96/attachment-0001.obj>


More information about the erlang-bugs mailing list