Browse Source

Merged revisions 586-587 via svnmerge from
/trunk

git-svn-id: branches/fixes_2_0@676 -

peter 20 years ago
parent
commit
417b57cc82
2 changed files with 3 additions and 2 deletions
  1. 1 1
      compiler/ncnv.pas
  2. 2 1
      compiler/ninl.pas

+ 1 - 1
compiler/ncnv.pas

@@ -1719,7 +1719,7 @@ implementation
               else if is_ordinal(resulttype.def) then
                 begin
                    hp:=cordconstnode.create(TConstExprInt(tpointerconstnode(left).value),
-                     resulttype,true);
+                     resulttype,not(nf_explicit in flags));
                    result:=hp;
                    exit;
                 end;

+ 2 - 1
compiler/ninl.pas

@@ -2176,7 +2176,7 @@ implementation
                        hpp := cordconstnode.create(1,tcallparanode(left).left.resulttype,false);
                      end;
                    if (tcallparanode(left).left.resulttype.def.deftype=pointerdef) then
-                     inserttypeconv_internal(hpp,ptrinttype);
+                     inserttypeconv_internal(hpp,sinttype);
                    { make sure we don't call functions part of the left node twice (and generally }
                    { optimize the code generation)                                                }
                    if node_complexity(tcallparanode(left).left) > 1 then
@@ -2199,6 +2199,7 @@ implementation
                    else
                      hpp := caddnode.create(subn,hp,hpp);
                    { assign result of addition }
+                   inserttypeconv_internal(hpp,hp.resulttype);
                    addstatement(newstatement,cassignmentnode.create(hp.getcopy,hpp));
                    { deallocate the temp }
                    if assigned(tempnode) then