From c4f9ec91c92b9d018b24be606b1c7cf74460cd66 Mon Sep 17 00:00:00 2001 From: Nikolay Nikolov Date: Tue, 25 Jan 2022 12:56:02 +0200 Subject: [PATCH] + fix support for 8-byte records, held in a register pair on the WebAssembly target. This fixes #39524 --- compiler/wasm32/hlcgcpu.pas | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/compiler/wasm32/hlcgcpu.pas b/compiler/wasm32/hlcgcpu.pas index a3aa7445d5..38a345448a 100644 --- a/compiler/wasm32/hlcgcpu.pas +++ b/compiler/wasm32/hlcgcpu.pas @@ -45,6 +45,7 @@ uses { checks whether the type needs special methodptr-like handling, when stored in a LOC_REGISTER location. This applies to the following types: - method pointers + - 8-byte records - nested proc ptrs When stored in a LOC_REGISTER tlocation, these types use both register and registerhi with the following sizes: @@ -301,15 +302,16 @@ implementation function thlcgwasm.is_methodptr_like_type(d:tdef): boolean; var - is_methodptr, is_nestedprocptr: Boolean; + is_8byterecord, is_methodptr, is_nestedprocptr: Boolean; begin + is_8byterecord:=(d.typ=recorddef) and (d.size=8); is_methodptr:=(d.typ=procvardef) and (po_methodpointer in tprocvardef(d).procoptions) and not(po_addressonly in tprocvardef(d).procoptions); is_nestedprocptr:=(d.typ=procvardef) and is_nested_pd(tprocvardef(d)) and not(po_addressonly in tprocvardef(d).procoptions); - result:=is_methodptr or is_nestedprocptr; + result:=is_8byterecord or is_methodptr or is_nestedprocptr; end; constructor thlcgwasm.create;