From 5be84e807933f3bb545db3502e9787d5e0b271a2 Mon Sep 17 00:00:00 2001 From: Jonas Maebe Date: Fri, 22 May 2020 13:11:52 +0000 Subject: [PATCH] * replaced custom packed record with tmethod git-svn-id: trunk@45465 - --- compiler/ncnv.pas | 31 +++++++++++-------------------- 1 file changed, 11 insertions(+), 20 deletions(-) diff --git a/compiler/ncnv.pas b/compiler/ncnv.pas index fde18bf98a..9d836c640b 100644 --- a/compiler/ncnv.pas +++ b/compiler/ncnv.pas @@ -2393,17 +2393,14 @@ implementation type tprocedureofobject = function : tnode of object; var - r : packed record - proc : pointer; - obj : pointer; - end; + r : TMethod; begin result:=nil; { this is a little bit dirty but it works } { and should be quite portable too } - r.proc:=resultdefconvert[c]; - r.obj:=self; - if assigned(r.proc) then + r.Code:=resultdefconvert[c]; + r.Data:=self; + if assigned(r.Code) then result:=tprocedureofobject(r)(); end; @@ -3981,16 +3978,13 @@ implementation type tprocedureofobject = function : tnode of object; var - r : packed record - proc : pointer; - obj : pointer; - end; + r : TMethod; begin { this is a little bit dirty but it works } { and should be quite portable too } - r.proc:=firstconvert[c]; - r.obj:=self; - if not assigned(r.proc) then + r.Code:=firstconvert[c]; + r.Data:=self; + if not assigned(r.Code) then internalerror(200312081); first_call_helper:=tprocedureofobject(r)() end; @@ -4262,16 +4256,13 @@ implementation tprocedureofobject = procedure of object; var - r : packed record - proc : pointer; - obj : pointer; - end; + r : TMethod; begin { this is a little bit dirty but it works } { and should be quite portable too } - r.proc:=secondconvert[c]; - r.obj:=self; + r.Code:=secondconvert[c]; + r.Data:=self; tprocedureofobject(r)(); end;