[erlang-bugs] bug in bs_put_integer

Bjorn Gustavsson <>
Thu Dec 20 12:29:08 CET 2007


"Fredrik Svahn" <> writes:

> Just out of curiosity, does this imply that the above is something that will
> typically generate an error at compile time instead of at run time in
> R12B-1? Or will you handle it as a binary when the compiler is sure that is
> a binary and not the default integer type? It is probably a common beginners
> mistake to forget the TypeSpecifier.

Short answer: It will still be an error at run-time in R12B-1. There will probably not be
a warning at compile time in R12B-1.

In future releases, the compiler will probably generate more warnings
for mistakes with binaries. It might not happen in R12B-1, since there
is currently no filename/line number information available in the
compiler pass (beam_bsm) that could easily detect the
discrepancy. (Also, only a very limited class of errors would be
discovered, while others would go unnoticed.)  What we want to do is
to incorporate a type analysis pass into the compiler, and use the
result of the pass both for better optimizations and better
warnings. It is unlikely to happen in R12B-1.

/Bjorn

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



More information about the erlang-bugs mailing list