mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-12-04 08:28:18 +01:00
* wrapcomplexinlinepara takes care of function results which need different temp. handling, resolves #34438
* tw34438 failed with -O3, fixes also dfa for inline functions returning results as "complex" parameter git-svn-id: trunk@40202 -
This commit is contained in:
parent
e63433c88c
commit
34d11046e0
1
.gitattributes
vendored
1
.gitattributes
vendored
@ -16408,6 +16408,7 @@ tests/webtbs/tw3435.pp svneol=native#text/plain
|
||||
tests/webtbs/tw34380.pp svneol=native#text/plain
|
||||
tests/webtbs/tw3441.pp svneol=native#text/plain
|
||||
tests/webtbs/tw3443.pp svneol=native#text/plain
|
||||
tests/webtbs/tw34438.pp svneol=native#text/pascal
|
||||
tests/webtbs/tw3444.pp svneol=native#text/plain
|
||||
tests/webtbs/tw34442.pp svneol=native#text/plain
|
||||
tests/webtbs/tw3456.pp svneol=native#text/plain
|
||||
|
||||
@ -4832,11 +4832,16 @@ implementation
|
||||
ptrtype: tdef;
|
||||
tempnode: ttempcreatenode;
|
||||
paraaddr: taddrnode;
|
||||
isfuncretnode : boolean;
|
||||
begin
|
||||
ptrtype:=cpointerdef.getreusable(para.left.resultdef);
|
||||
tempnode:=ctempcreatenode.create(ptrtype,ptrtype.size,tt_persistent,true);
|
||||
addstatement(inlineinitstatement,tempnode);
|
||||
addstatement(inlinecleanupstatement,ctempdeletenode.create(tempnode));
|
||||
isfuncretnode:=nf_is_funcret in para.left.flags;
|
||||
if isfuncretnode then
|
||||
addstatement(inlinecleanupstatement,ctempdeletenode.create_normal_temp(tempnode))
|
||||
else
|
||||
addstatement(inlinecleanupstatement,ctempdeletenode.create(tempnode));
|
||||
{ inherit addr_taken flag }
|
||||
if (tabstractvarsym(para.parasym).addr_taken) then
|
||||
tempnode.includetempflag(ti_addr_taken);
|
||||
@ -4848,6 +4853,8 @@ implementation
|
||||
addstatement(inlineinitstatement,cassignmentnode.create(ctemprefnode.create(tempnode),
|
||||
paraaddr));
|
||||
para.left:=cderefnode.create(ctemprefnode.create(tempnode));
|
||||
if isfuncretnode then
|
||||
Include(para.left.flags,nf_is_funcret);
|
||||
end;
|
||||
|
||||
|
||||
|
||||
@ -383,6 +383,7 @@ unit optdfa;
|
||||
temprefn,
|
||||
loadn,
|
||||
typeconvn,
|
||||
derefn,
|
||||
assignn:
|
||||
begin
|
||||
if not(assigned(node.optinfo^.def)) and
|
||||
|
||||
42
tests/webtbs/tw34438.pp
Normal file
42
tests/webtbs/tw34438.pp
Normal file
@ -0,0 +1,42 @@
|
||||
{%norun}
|
||||
{$mode objfpc}
|
||||
uses
|
||||
types,math;
|
||||
|
||||
type
|
||||
PGtkWidget = pointer;
|
||||
PGtkNotebook = pointer;
|
||||
|
||||
function MyRect(Left,Top,Right,Bottom : Integer) : TRect; inline;
|
||||
|
||||
begin
|
||||
MyRect.Left:=Left;
|
||||
MyRect.Top:=Top;
|
||||
MyRect.Right:=Right;
|
||||
MyRect.Bottom:=Bottom;
|
||||
end;
|
||||
|
||||
function GetWidgetClientRect(TheWidget: PGtkWidget): TRect;
|
||||
var
|
||||
Widget, ClientWidget: PGtkWidget;
|
||||
AChild: PGtkWidget;
|
||||
|
||||
procedure GetNoteBookClientRect(NBWidget: PGtkNotebook);
|
||||
var
|
||||
PageIndex: LongInt;
|
||||
PageWidget: PGtkWidget;
|
||||
FrameBorders: TRect;
|
||||
aWidth: LongInt;
|
||||
aHeight: LongInt;
|
||||
begin
|
||||
Result:=MyRect(0,0,
|
||||
Max(0,AWidth-FrameBorders.Left-FrameBorders.Right),
|
||||
Max(0,aHeight-FrameBorders.Top-FrameBorders.Bottom));
|
||||
end;
|
||||
|
||||
begin
|
||||
end;
|
||||
|
||||
|
||||
begin
|
||||
end.
|
||||
Loading…
Reference in New Issue
Block a user