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

Richard Carlsson carlsson.richard@REDACTED
Wed Oct 12 10:20:25 CEST 2011


On 10/12/2011 09:31 AM, Rene Kijewski wrote:
> 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é

I think that the inliner should still not crash on this, so I'll put it 
in my list of open issues, but it's got pretty low priority.

     /Richard



More information about the erlang-bugs mailing list