mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-20 18:09:27 +02:00
* support LOC_(C)SUBSETREG in tcgvecnode.pass_generate_code, can also occur
for function results (patch by Do-wan Kim, mantis #29064) git-svn-id: trunk@32516 -
This commit is contained in:
parent
f5eaf7ddde
commit
9dc5f1acb4
1
.gitattributes
vendored
1
.gitattributes
vendored
@ -14879,6 +14879,7 @@ tests/webtbs/tw2904.pp svneol=native#text/plain
|
||||
tests/webtbs/tw29040.pp svneol=native#text/plain
|
||||
tests/webtbs/tw29053.pp svneol=native#text/pascal
|
||||
tests/webtbs/tw29053b.pp svneol=native#text/pascal
|
||||
tests/webtbs/tw29064.pp svneol=native#text/plain
|
||||
tests/webtbs/tw2908.pp svneol=native#text/plain
|
||||
tests/webtbs/tw2911.pp svneol=native#text/plain
|
||||
tests/webtbs/tw2912.pp svneol=native#text/plain
|
||||
|
@ -963,8 +963,10 @@ implementation
|
||||
begin
|
||||
{ may happen in case of function results }
|
||||
case left.location.loc of
|
||||
LOC_CSUBSETREG,
|
||||
LOC_CREGISTER,
|
||||
LOC_CMMREGISTER,
|
||||
LOC_SUBSETREG,
|
||||
LOC_REGISTER,
|
||||
LOC_MMREGISTER:
|
||||
hlcg.location_force_mem(current_asmdata.CurrAsmList,left.location,left.resultdef);
|
||||
|
46
tests/webtbs/tw29064.pp
Normal file
46
tests/webtbs/tw29064.pp
Normal file
@ -0,0 +1,46 @@
|
||||
program ie200411013;
|
||||
|
||||
{$mode objfpc}{$H+}
|
||||
|
||||
uses
|
||||
ctypes;
|
||||
|
||||
type
|
||||
in_addr = record
|
||||
s_bytes : array[1..4] of byte;
|
||||
end;
|
||||
|
||||
sockaddr = record
|
||||
sin_family: word;
|
||||
sin_port: word;
|
||||
sin_addr: in_addr;
|
||||
end;
|
||||
TSockAddr = sockaddr;
|
||||
|
||||
{ TSocketStream }
|
||||
|
||||
TSocketStream = class
|
||||
private
|
||||
function GetRemoteAddress: TSockAddr;
|
||||
Public
|
||||
property RemoteAddress: TSockAddr read GetRemoteAddress;
|
||||
end;
|
||||
|
||||
function TSocketStream.GetRemoteAddress: TSockAddr;
|
||||
var
|
||||
sa: sockaddr;
|
||||
begin
|
||||
sa.sin_addr.s_bytes[2]:=4;
|
||||
result:=sa;
|
||||
end;
|
||||
|
||||
var
|
||||
ss: TSocketStream;
|
||||
b: byte;
|
||||
begin
|
||||
ss:=TSocketStream.create;
|
||||
b := ss.RemoteAddress.sin_addr.s_bytes[2];
|
||||
if b<>4 then
|
||||
halt(1);
|
||||
end.
|
||||
|
Loading…
Reference in New Issue
Block a user