From 38993ae7e8975080739e07dc4ce99526d696db14 Mon Sep 17 00:00:00 2001 From: peter Date: Tue, 18 Oct 2005 12:33:27 +0000 Subject: [PATCH] * support procvar^, with procvar returning a procvardef in tp/mac modes git-svn-id: trunk@1477 - --- compiler/pexpr.pas | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/compiler/pexpr.pas b/compiler/pexpr.pas index 1925ef038f..2f3cde9aa8 100644 --- a/compiler/pexpr.pas +++ b/compiler/pexpr.pas @@ -1707,6 +1707,18 @@ implementation _CARET: begin consume(_CARET); + + { support tp/mac procvar^ if the procvar returns a + pointer type } + if ((m_tp_procvar in aktmodeswitches) or + (m_mac_procvar in aktmodeswitches)) and + (p1.resulttype.def.deftype=procvardef) and + (tprocvardef(p1.resulttype.def).rettype.def.deftype=pointerdef) then + begin + p1:=ccallnode.create_procvar(nil,p1); + resulttypepass(p1); + end; + if (p1.resulttype.def.deftype<>pointerdef) then begin { ^ as binary operator is a problem!!!! (FK) } @@ -1717,9 +1729,7 @@ implementation p1:=cerrornode.create; end else - begin - p1:=cderefnode.create(p1); - end; + p1:=cderefnode.create(p1); end; _LECKKLAMMER: