Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fix bug related to the handling of is_number/1 by the range analysis

The following module produced erroneous results when compiled with HiPE:


foo(X) when is_number(X) ->


  1> c(a).
  2> a:foo(0).
  3> hipe:c(a).
  4> a:foo(0).
  false      % *** WRONG ***

The problem was that the 'number' case for the `hipe_icode:type_test/1`
was going to the default case where the argument was determined as being
something other than an integer. Thanks to Sebastian Egner and Johannes
Weißl for bringing the bug into attention. Fixed on the day it was reported.
  • Loading branch information...
commit 6907ed77452dcf409e0e3540cf7bd876e87b54b9 1 parent 6176e8a
@kostis authored
Showing with 2 additions and 0 deletions.
  1. +2 −0  lib/hipe/icode/hipe_icode_range.erl
2  lib/hipe/icode/hipe_icode_range.erl
@@ -784,6 +784,8 @@ analyse_type(Type, Info, Rewrite) ->
integer ->
TrueRange = inf(any_range(), OldVarRange),
FalseRange = inf(none_range(), OldVarRange);
+ number ->
+ TrueRange = FalseRange = OldVarRange;
_ ->
TrueRange = inf(none_range(), OldVarRange),
FalseRange = OldVarRange
Please sign in to comment.
Something went wrong with that request. Please try again.