소스 검색

Fixed division by zero check

Taddeus Kroes 12 년 전
부모
커밋
94299b18ac
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      phases/constprop.ml

+ 1 - 1
phases/constprop.ml

@@ -56,7 +56,7 @@ let eval = function
   | Binop (Mul, Const (FloatVal left, _), Const (FloatVal right, _), ann) ->
     Const (FloatVal (left *. right), ann)
 
-  | Binop (Div, Const (IntVal left, _), Const (IntVal right, _), ann) when right != 0l ->
+  | Binop (Div, Const (IntVal left, _), Const (IntVal right, _), ann) when right <> 0l ->
     Const (IntVal (left / right), ann)
   | Binop (Div, Const (FloatVal left, _), Const (FloatVal right, _), ann) ->
     Const (FloatVal (left /. right), ann)