more real-world static analysis results

Thomas Lindgren thomasl_erlang@REDACTED
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,
> self());
>           _ -> never_mind
>       end,
> 
>      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.

Best,
Thomas




		
__________________________________
Do you Yahoo!?
Yahoo! Mail Address AutoComplete - You start. We finish.
http://promotions.yahoo.com/new_mail 



More information about the erlang-questions mailing list