From 1e33924f732484e83caf15cbd3a289630c37c50e Mon Sep 17 00:00:00 2001 From: nickysn Date: Tue, 1 Dec 2015 15:58:11 +0000 Subject: [PATCH] + support procvardefs (address only) in i8086's hlcgcpu.getaddressregister; this fixes e.g. obtaining the address of a method in i8086 far code memory models after r32414 git-svn-id: trunk@32562 - --- compiler/i8086/hlcgcpu.pas | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/compiler/i8086/hlcgcpu.pas b/compiler/i8086/hlcgcpu.pas index 8419973efe..53437211b8 100644 --- a/compiler/i8086/hlcgcpu.pas +++ b/compiler/i8086/hlcgcpu.pas @@ -248,6 +248,15 @@ implementation if is_implicit_pointer_object_type(size) or is_implicit_array_pointer(size) then size:=voidpointertype; + { procvars follow the default code pointer size for the current memory model } + if size.typ=procvardef then + if ((po_methodpointer in tprocvardef(size).procoptions) or + is_nested_pd(tprocvardef(size))) and + not(po_addressonly in tprocvardef(size).procoptions) then + internalerror(2015120101) + else + size:=voidcodepointertype; + if is_farpointer(size) or is_hugepointer(size) then Result:=cg.getintregister(list,OS_32) else