* insert explicit typecast to left type of inc(left,right) before

assigning the value after an addn
  * for inc(pointer,X) convert X to sinttype instead of ptrinttype
    to support also negative values of X

git-svn-id: trunk@587 -
This commit is contained in:
peter 2005-07-05 07:15:50 +00:00
parent 91b59bc62a
commit 6846195a6c

View File

@ -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