Another HiPE bug?
Wed Oct 22 23:55:51 CEST 2003
David Wallin wrote:
> A binary consisting of an even number of ones is taken as argument. A
> randomly picked bit is flipped and the new binary returned. As shown
> below, this is not the case (the input in this case is
> <<2#00000011>>). I also tried with other inputs and the result was
> always <<192>> when compiled with HiPE.
We confirm this bug. It is related to the construction of binaries
with variable-sized segments. A minimal example that shows the
In BEAM the call construct(8) returns <<42>> as it should.
In native code, it returns <<192>>.
Apparently, this only affects the first segment of the binary...
Thanks for this report. We'll look into this.
PS. Your previous bug report is actually a problem in the loader
and requires help from the OTP team to be fixed... It is due
to the magic that the BEAM loader performs to create the code
for module_info/* when loading a .beam file. A simple way to
get around it, is to change the line that reads:
Info = module_info(),
Info = apply(?MODULE, module_info, ),
Amazing how easily you can fool the BEAM compiler, isn't it?
More information about the erlang-questions