Browse Source

* fixed the spurious compiler warnings and added proper rangechecking when using Mem[] on i8086

git-svn-id: trunk@24779 -
nickysn 12 years ago
parent
commit
dd0d2d6bf5
1 changed files with 7 additions and 4 deletions
  1. 7 4
      compiler/pexpr.pas

+ 7 - 4
compiler/pexpr.pas

@@ -1870,14 +1870,17 @@ implementation
 {$if defined(i8086)}
 {$if defined(i8086)}
                                if try_to_consume(_COLON) then
                                if try_to_consume(_COLON) then
                                 begin
                                 begin
-                                  p2:=ctypeconvnode.create_explicit(p2,u32inttype);
+                                  inserttypeconv(p2,u16inttype);
+                                  inserttypeconv_internal(p2,u32inttype);
                                   p3:=cshlshrnode.create(shln,p2,cordconstnode.create($10,s16inttype,false));
                                   p3:=cshlshrnode.create(shln,p2,cordconstnode.create($10,s16inttype,false));
                                   p2:=comp_expr(true,false);
                                   p2:=comp_expr(true,false);
+                                  inserttypeconv(p2,u16inttype);
+                                  inserttypeconv_internal(p2,u32inttype);
                                   p2:=caddnode.create(addn,p2,p3);
                                   p2:=caddnode.create(addn,p2,p3);
                                   case tloadnode(p1).symtableentry.name of
                                   case tloadnode(p1).symtableentry.name of
-                                    'MEM': p2:=ctypeconvnode.create_explicit(p2,bytefarpointertype);
-                                    'MEMW': p2:=ctypeconvnode.create_explicit(p2,wordfarpointertype);
-                                    'MEML': p2:=ctypeconvnode.create_explicit(p2,longintfarpointertype);
+                                    'MEM': p2:=ctypeconvnode.create_internal(p2,bytefarpointertype);
+                                    'MEMW': p2:=ctypeconvnode.create_internal(p2,wordfarpointertype);
+                                    'MEML': p2:=ctypeconvnode.create_internal(p2,longintfarpointertype);
                                     else
                                     else
                                       internalerror(2013053102);
                                       internalerror(2013053102);
                                   end;
                                   end;