Skip to content

Commit 5879002

Browse files
committed
fbc: thiscall, hidden param for returning structs
1 parent e4efcea commit 5879002

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/compiler/ast-node-call.bas

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ function astLoadCALL( byval n as ASTNODE ptr ) as IRVREG ptr
231231
if( symbProcReturnsOnStack( proc ) ) then
232232
'' Pop hidden ptr if cdecl and target doesn't want the callee
233233
'' to do it, despite it being cdecl.
234-
if( (symbGetProcMode( proc ) = FB_FUNCMODE_CDECL) and _
234+
if( ((symbGetProcMode( proc ) = FB_FUNCMODE_CDECL) or (symbGetProcMode( proc ) = FB_FUNCMODE_THISCALL)) and _
235235
((env.target.options and FB_TARGETOPT_CALLEEPOPSHIDDENPTR) = 0) ) then
236236
bytestopop += env.pointersize
237237
end if

src/compiler/symb-proc.bas

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ end function
160160
'' Calculate the number of bytes the procedure needs to pop from stack when returning
161161
function symbProcCalcBytesToPop( byval proc as FBSYMBOL ptr ) as longint
162162
dim as longint bytestopop = 0
163-
var notcdecl = (symbGetProcMode( proc ) <> FB_FUNCMODE_CDECL)
163+
var notcdecl = (symbGetProcMode( proc ) <> FB_FUNCMODE_CDECL) and (symbGetProcMode( proc ) <> FB_FUNCMODE_THISCALL)
164164

165165
'' Need to pop parameters in case of stdcall/pascal, but not for cdecl
166166
if( notcdecl ) then

0 commit comments

Comments
 (0)