From 3e11f1b2fe7e1fab5c19e70087c48a70d5d15f46 Mon Sep 17 00:00:00 2001 From: Jonas Maebe Date: Sun, 13 Oct 2019 09:31:08 +0000 Subject: [PATCH] * fix length calculation of winlike widestrings in Dwarf 3 (patch by Martin Friebe, mantis #35566) git-svn-id: trunk@43182 - --- compiler/dbgdwarf.pas | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/compiler/dbgdwarf.pas b/compiler/dbgdwarf.pas index 23acb5a917..58bef2bf31 100644 --- a/compiler/dbgdwarf.pas +++ b/compiler/dbgdwarf.pas @@ -4337,7 +4337,11 @@ implementation { yes -> length = 0 } current_asmdata.asmlists[al_dwarf_info].concat(tai_const.create_8bit(ord(DW_OP_lit0))); current_asmdata.asmlists[al_dwarf_info].concat(tai_const.create_8bit(ord(DW_OP_skip))); - current_asmdata.asmlists[al_dwarf_info].concat(tai_const.create_16bit_unaligned(3)); + if upperopcodes=16 then + { skip the extra deref_size argument and the division by two of the length } + current_asmdata.asmlists[al_dwarf_info].concat(tai_const.create_16bit_unaligned(6)) + else + current_asmdata.asmlists[al_dwarf_info].concat(tai_const.create_16bit_unaligned(3)); { no -> load length } if upperopcodes=16 then { for Windows WideString the size is always a DWORD }