[erlang-bugs] sys_core_fold forgets about aliases when marking bit string variables for context reusing
Anthony Ramine
n.oxyde@REDACTED
Sat Nov 16 13:58:51 CET 2013
Finally I may have found one.
Tell me where I should write tests for that and I will add them.
git fetch https://github.com/nox/otp.git core-clause-subst
https://github.com/nox/otp/compare/erlang:maint...core-clause-subst
https://github.com/nox/otp/compare/erlang:maint...core-clause-subst.patch
Regards,
--
Anthony Ramine
Le 16 nov. 2013 à 13:27, Anthony Ramine <n.oxyde@REDACTED> a écrit :
> Hello,
>
> I have trying to fix a bug for a while without success so I post it here.
>
> t(Bin1) ->
> case Bin1 of
> <<>> -> ok;
> Bin2 ->
> case Bin1 of
> <<0>> -> ok;
> _ -> Bin2
> end
> end.
>
> In the following function, sys_core_fold fails to see that Bin2 is an alias of Bin1 and does not emit a bs_context_to_binary, making beam_validator crash quite violently:
>
> t: function t/1+17:
> Internal consistency check failed - please report this bug.
> Instruction: return
> Error: {match_context,{x,0}}:
>
> Regards,
>
> --
> Anthony Ramine
>
More information about the erlang-bugs
mailing list