From 7dc515b62c49d622d8136b2679e10a558393f09b Mon Sep 17 00:00:00 2001 From: Jeppe Johansen Date: Sun, 7 Jul 2019 14:37:45 +0000 Subject: [PATCH] - Fix result type of SizeOf and BitSizeOf to use sizesint instead of sint. git-svn-id: trunk@42337 - --- compiler/ninl.pas | 12 ++++++------ compiler/pexpr.pas | 8 ++++---- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/compiler/ninl.pas b/compiler/ninl.pas index fc07b0f995..0bb02d4212 100644 --- a/compiler/ninl.pas +++ b/compiler/ninl.pas @@ -2963,13 +2963,13 @@ implementation if assigned(hightree) then begin hp:=caddnode.create(addn,hightree, - cordconstnode.create(1,sinttype,false)); + cordconstnode.create(1,sizesinttype,false)); if (left.resultdef.typ=arraydef) then if not is_packed_array(tarraydef(left.resultdef)) then begin if (tarraydef(left.resultdef).elesize<>1) then hp:=caddnode.create(muln,hp,cordconstnode.create(tarraydef( - left.resultdef).elesize,sinttype,true)); + left.resultdef).elesize,sizesinttype,true)); end else if (tarraydef(left.resultdef).elepackedbitsize <> 8) then begin @@ -2977,24 +2977,24 @@ implementation if (hp.nodetype <> ordconstn) then internalerror(2006081511); hp.free; - hp := cordconstnode.create(left.resultdef.size,sinttype,true); + hp := cordconstnode.create(left.resultdef.size,sizesinttype,true); { hp:= - ctypeconvnode.create_explicit(sinttype, + ctypeconvnode.create_explicit(sizesinttype, cmoddivnode.create(divn, caddnode.create(addn, caddnode.create(muln,hp,cordconstnode.create(tarraydef( left.resultdef).elepackedbitsize,s64inttype,true)), cordconstnode.create(a,s64inttype,true)), cordconstnode.create(8,s64inttype,true)), - sinttype); + sizesinttype); } end; result:=hp; end; end else - resultdef:=sinttype; + resultdef:=sizesinttype; end; in_typeof_x: diff --git a/compiler/pexpr.pas b/compiler/pexpr.pas index 6c25c7290d..0eee0ff24e 100644 --- a/compiler/pexpr.pas +++ b/compiler/pexpr.pas @@ -445,7 +445,7 @@ implementation statement_syssym:=geninlinenode(in_sizeof_x,false,p1); { no packed bit support for these things } if l=in_bitsizeof_x then - statement_syssym:=caddnode.create(muln,statement_syssym,cordconstnode.create(8,sinttype,true)); + statement_syssym:=caddnode.create(muln,statement_syssym,cordconstnode.create(8,sizesinttype,true)); end else begin @@ -460,12 +460,12 @@ implementation not((p1.nodetype = subscriptn) and is_packed_record_or_object(tsubscriptnode(p1).left.resultdef))) then begin - statement_syssym:=cordconstnode.create(p1.resultdef.size,sinttype,true); + statement_syssym:=cordconstnode.create(p1.resultdef.size,sizesinttype,true); if (l = in_bitsizeof_x) then - statement_syssym:=caddnode.create(muln,statement_syssym,cordconstnode.create(8,sinttype,true)); + statement_syssym:=caddnode.create(muln,statement_syssym,cordconstnode.create(8,sizesinttype,true)); end else - statement_syssym:=cordconstnode.create(p1.resultdef.packedbitsize,sinttype,true); + statement_syssym:=cordconstnode.create(p1.resultdef.packedbitsize,sizesinttype,true); { p1 not needed !} p1.destroy; end;