[erlang-bugs] Lengthy subfunctions in Core Erlang code crash the compiler if inlining is turned on

Rene Kijewski rene.kijewski@REDACTED
Wed Oct 12 09:31:53 CEST 2011


Am Tue, 11 Oct 2011 07:54:39 +0200
schrieb Björn Gustavsson <bgustavsson@REDACTED>:

> I am not sure whether this should be classified as a bug or not.

Hello, thank you for the answer!

Your explanation was right. Inserting
    <Some> when 'true' -> primop 'match_fail' ({'function_clause', Some})
into the case block fixes the problem.

> The Core Erlang specification says that the behavior is undefined
> if no clause can be selected in a case. Looking at only at the
> case statement itself, it is impossible to tell whether the clause
> will always be selected. Only by looking at the entire program can
> it been seen that the clause will indeed always be selected.
> 
> I am not sure yet whether we will attempt to fix this
> problem in the inliner, since it can only happen when
> compiling from Core Erlang code, never from Erlang
> code.

I assumed a match_fail was inserted automatically if absent, but that
was only a guess, I -- accidentally -- proved wrong.

So: no bug.

Best regards
René

-- 
()  ascii ribbon campaign - against HTML e-mail
/\  www.asciiribbon.org   - against proprietary attachments
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
URL: <http://erlang.org/pipermail/erlang-bugs/attachments/20111012/d1e4005c/attachment.bin>


More information about the erlang-bugs mailing list