Browse Source

* fixed webbug 1222 ("merged")

Jonas Maebe 25 years ago
parent
commit
95351bb8f7
1 changed files with 11 additions and 2 deletions
  1. 11 2
      compiler/i386/n386set.pas

+ 11 - 2
compiler/i386/n386set.pas

@@ -718,7 +718,10 @@ implementation
                   if first then
                   if first then
                     begin
                     begin
                        { have we to ajust the first value ? }
                        { have we to ajust the first value ? }
-                       if t^._low>get_min_value(left.resulttype) then
+                       if (with_sign and
+                           (t^._low>get_min_value(left.resulttype))) or
+                          (not with_sign and
+                           (cardinal(t^._low) > cardinal(get_min_value(left.resulttype)))) then
                          gensub(t^._low);
                          gensub(t^._low);
                     end
                     end
                   else
                   else
@@ -726,6 +729,9 @@ implementation
                       { if there is no unused label between the last and the }
                       { if there is no unused label between the last and the }
                       { present label then the lower limit can be checked    }
                       { present label then the lower limit can be checked    }
                       { immediately. else check the range in between:       }
                       { immediately. else check the range in between:       }
+
+                      { note: you can't use gensub() here because dec doesn't }
+                      { change the carry flag (needed for jmp_lxx) (JM)       }
                       emit_const_reg(A_SUB,opsize,t^._low-last,hregister);
                       emit_const_reg(A_SUB,opsize,t^._low-last,hregister);
                       emitjmp(jmp_le,elselabel);
                       emitjmp(jmp_le,elselabel);
                     end;
                     end;
@@ -1061,7 +1067,10 @@ begin
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.4  2000-11-13 14:44:36  jonas
+  Revision 1.5  2000-11-17 14:09:00  jonas
+    * fixed webbug 1222 ("merged")
+
+  Revision 1.4  2000/11/13 14:44:36  jonas
     * fixes so no more range errors with improved range checking code
     * fixes so no more range errors with improved range checking code
 
 
   Revision 1.3  2000/10/31 22:02:57  peter
   Revision 1.3  2000/10/31 22:02:57  peter