From 8d11d0d6bfb1bd7af850e7010163b1ec2ac11a54 Mon Sep 17 00:00:00 2001 From: peter Date: Sun, 5 Aug 2001 13:19:51 +0000 Subject: [PATCH] * partly fix for proc of obj=nil --- compiler/i386/n386ld.pas | 10 +++++----- compiler/ncnv.pas | 14 +++++++++++++- 2 files changed, 18 insertions(+), 6 deletions(-) diff --git a/compiler/i386/n386ld.pas b/compiler/i386/n386ld.pas index fdfa157274..d06b053383 100644 --- a/compiler/i386/n386ld.pas +++ b/compiler/i386/n386ld.pas @@ -570,7 +570,7 @@ implementation LOC_REFERENCE, LOC_MEM : begin { extra handling for ordinal constants } - if (right.nodetype=ordconstn) or + if (right.nodetype in [ordconstn,pointerconstn,niln]) or (loc=LOC_CREGISTER) then begin case left.resulttype.def.size of @@ -586,7 +586,7 @@ implementation emit_ref_reg(A_MOV,opsize, newreference(right.location.reference), left.location.register); - if is_64bitint(right.resulttype.def) then + if left.resulttype.def.size=8 then begin r:=newreference(right.location.reference); inc(r^.offset,4); @@ -599,7 +599,7 @@ implementation end else begin - if is_64bitint(right.resulttype.def) then + if left.resulttype.def.size=8 then begin emit_const_ref(A_MOV,opsize, longint(lo(tordconstnode(right).value)), @@ -1086,8 +1086,8 @@ begin end. { $Log$ - Revision 1.16 2001-08-01 21:47:48 peter - * fixed passing of array of record or shortstring to open array + Revision 1.17 2001-08-05 13:19:51 peter + * partly fix for proc of obj=nil Revision 1.15 2001/07/28 15:13:17 peter * fixed opsize for assignment with LOC_JUMP diff --git a/compiler/ncnv.pas b/compiler/ncnv.pas index 0cca7cae88..45380ed259 100644 --- a/compiler/ncnv.pas +++ b/compiler/ncnv.pas @@ -931,6 +931,15 @@ implementation left:=hp; end; + { remove typeconv after niln } + if (left.nodetype=niln) then + begin + left.resulttype:=resulttype; + result:=left; + left:=nil; + exit; + end; + { ordinal contants can be directly converted } if (left.nodetype=ordconstn) and is_ordinal(resulttype.def) then begin @@ -1428,7 +1437,10 @@ begin end. { $Log$ - Revision 1.30 2001-07-30 20:59:27 peter + Revision 1.31 2001-08-05 13:19:51 peter + * partly fix for proc of obj=nil + + Revision 1.30 2001/07/30 20:59:27 peter * m68k updates from v10 merged Revision 1.29 2001/07/08 21:00:15 peter