[erlang-bugs] R13A Internal compiler error when using a record in a guard within a try/catch block

Bjorn Gustavsson bgustavsson@REDACTED
Thu Apr 16 16:58:25 CEST 2009


On Thu, Apr 16, 2009 at 2:40 PM, David Sveningsson <ext@REDACTED> wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Hi, when compiling the attached code with R13A erlc the compiler crashes
> with the following error:
>
> Function: do_stuff/1
> temp/test.erl:none: internal error in v3_codegen;
> crash reason: {{case_clause,
>                   {'EXIT',
>                       {function_clause,
>                           [{v3_codegen,longest,[[{ker0}],[]]},
>                            {v3_codegen,longest,2},
>                            {v3_codegen,sr_merge,2},
>                            {v3_codegen,match_cg,5},
>                            {v3_codegen,guard_match_cg,6},
>                            {v3_codegen,guard_cg,5},
>                            {v3_codegen,'-guard_cg_list/6-anonymous-0-',4},
>                            {v3_codegen,flatmapfoldl,3}]}}},
>               [{compile,'-select_passes/2-anonymous-2-',2},
>                {compile,'-internal_comp/4-anonymous-1-',2},
>                {compile,fold_comp,3},
>                {compile,internal_comp,4},
>                {compile,internal,3}]}
>
> There are many ways to workaround this:
>
> * Removing the try/catch block.
> * Putting the case block in a separate functions.
> * Assigning Foo#foo.bar to a local variable and use in guard instead.
>
> Either way, the compiler shouldn't crash. It is possible that this issue
> is already fixed as I've read some similar reports related to try/catch.

Yes, it shouldn't crash, and, yes, it has already been fixed. The correction
will be included in the R13B release.

/Björn

-- 
Björn Gustavsson, Erlang/OTP, Ericsson AB



More information about the erlang-bugs mailing list