more real-world static analysis results
Mon Oct 25 13:35:33 CEST 2004
--- Matthias Lang <matthias@REDACTED> wrote:
> - I use a compile-time preprocessor symbol to
> conditionally compile
> code, i.e.
> case ?STARTUP_EVENT of
> true -> gth_event:notify(failsafe_mode,
> _ -> never_mind
> Dialyzer sees this is a test which always goes
> the same way.
> (If anything, I'm a bit surprised that the beam
> compiler didn't
> optimise away the decision.)
The compiler *should* do that optimization; the
relevant code is sys_core_fold, I believe.
My R9C2 also compiles "case true of true -> ... end"
naively. However, R10B0 *does* optimize away the test.
The bug is really somewhere in R9, then.
Do you Yahoo!?
Yahoo! Mail Address AutoComplete - You start. We finish.
More information about the erlang-questions