Browse Source

* fix sqr() and abs() constant range check errors

peter 21 years ago
parent
commit
b815890d49
1 changed files with 6 additions and 3 deletions
  1. 6 3
      compiler/ninl.pas

+ 6 - 3
compiler/ninl.pas

@@ -1287,14 +1287,14 @@ implementation
                      if isreal then
                      if isreal then
                       hp:=crealconstnode.create(abs(vr),pbestrealtype^)
                       hp:=crealconstnode.create(abs(vr),pbestrealtype^)
                      else
                      else
-                      hp:=cordconstnode.create(abs(vl),left.resulttype,true);
+                      hp:=genintconstnode(abs(vl));
                    end;
                    end;
                  in_const_sqr :
                  in_const_sqr :
                    begin
                    begin
                      if isreal then
                      if isreal then
                       hp:=crealconstnode.create(sqr(vr),pbestrealtype^)
                       hp:=crealconstnode.create(sqr(vr),pbestrealtype^)
                      else
                      else
-                      hp:=cordconstnode.create(sqr(vl),left.resulttype,true);
+                      hp:=genintconstnode(sqr(vl));
                    end;
                    end;
                  in_const_odd :
                  in_const_odd :
                    begin
                    begin
@@ -2441,7 +2441,10 @@ begin
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.142  2004-08-08 16:00:56  florian
+  Revision 1.143  2004-08-25 15:56:35  peter
+    * fix sqr() and abs() constant range check errors
+
+  Revision 1.142  2004/08/08 16:00:56  florian
     * constant floating point assignments etc. are now overflow checked
     * constant floating point assignments etc. are now overflow checked
       if Q+ or R+ is turned on
       if Q+ or R+ is turned on