mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-09-13 03:29:30 +02:00
* 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:
parent
91b59bc62a
commit
6846195a6c
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user