--- Merging r39877 into '.':

U    compiler/x86_64/rax64att.pas
--- Recording mergeinfo for merge of r39877 into '.':
 U   .
--- Merging r39882 into '.':
U    compiler/nld.pas
A    tests/webtbf/tw34355.pp
--- Recording mergeinfo for merge of r39882 into '.':
 G   .
--- Merging r39885 into '.':
U    compiler/ncgrtti.pas
--- Recording mergeinfo for merge of r39885 into '.':
 G   .

# revisions: 39877,39882,39885

git-svn-id: branches/fixes_3_2@40286 -
This commit is contained in:
marco 2018-11-12 08:36:43 +00:00
parent e1d32d0fef
commit f42dffb36d
5 changed files with 51 additions and 41 deletions

1
.gitattributes vendored
View File

@ -14562,6 +14562,7 @@ tests/webtbf/tw3375.pp svneol=native#text/plain
tests/webtbf/tw3393.pp svneol=native#text/plain
tests/webtbf/tw3395.pp svneol=native#text/plain
tests/webtbf/tw3395a.pp svneol=native#text/plain
tests/webtbf/tw34355.pp svneol=native#text/pascal
tests/webtbf/tw3450.pp svneol=native#text/plain
tests/webtbf/tw3473.pp svneol=native#text/plain
tests/webtbf/tw3480.pp svneol=native#text/plain

View File

@ -1339,40 +1339,32 @@ implementation
procedure write_para(parasym:tparavarsym);
begin
{ only store user visible parameters }
if not(vo_is_hidden_para in parasym.varoptions) then
begin
{ write flags for current parameter }
write_param_flag(tcb,parasym);
{ write name of current parameter }
tcb.emit_shortstring_const(parasym.realname);
{ write name of type of current parameter }
write_rtti_name(tcb,parasym.vardef);
end;
{ write flags for current parameter }
write_param_flag(tcb,parasym);
{ write name of current parameter }
tcb.emit_shortstring_const(parasym.realname);
{ write name of type of current parameter }
write_rtti_name(tcb,parasym.vardef);
end;
procedure write_procedure_param(parasym:tparavarsym);
begin
{ only store user visible parameters }
if not(vo_is_hidden_para in parasym.varoptions) then
begin
{ every parameter is expected to start aligned }
tcb.begin_anonymous_record(
internaltypeprefixName[itp_rtti_proc_param]+tostr(length(parasym.realname)),
defaultpacking,min(reqalign,SizeOf(PInt)),
targetinfos[target_info.system]^.alignment.recordalignmin,
targetinfos[target_info.system]^.alignment.maxCrecordalign);
{ write flags for current parameter }
write_param_flag(tcb,parasym);
{ write param type }
if is_open_array(parasym.vardef) or is_array_of_const(parasym.vardef) then
write_rtti_reference(tcb,tarraydef(parasym.vardef).elementdef,fullrtti)
else
write_rtti_reference(tcb,parasym.vardef,fullrtti);
{ write name of current parameter }
tcb.emit_shortstring_const(parasym.realname);
tcb.end_anonymous_record;
end;
{ every parameter is expected to start aligned }
tcb.begin_anonymous_record(
internaltypeprefixName[itp_rtti_proc_param]+tostr(length(parasym.realname)),
defaultpacking,min(reqalign,SizeOf(PInt)),
targetinfos[target_info.system]^.alignment.recordalignmin,
targetinfos[target_info.system]^.alignment.maxCrecordalign);
{ write flags for current parameter }
write_param_flag(tcb,parasym);
{ write param type }
if is_open_array(parasym.vardef) or is_array_of_const(parasym.vardef) then
write_rtti_reference(tcb,tarraydef(parasym.vardef).elementdef,fullrtti)
else
write_rtti_reference(tcb,parasym.vardef,fullrtti);
{ write name of current parameter }
tcb.emit_shortstring_const(parasym.realname);
tcb.end_anonymous_record;
end;
var
@ -1392,7 +1384,7 @@ implementation
{ write parameter info. The parameters must be written in reverse order
if this method uses right to left parameter pushing! }
tcb.emit_ord_const(def.maxparacount,u8inttype);
tcb.emit_ord_const(def.paras.count,u8inttype);
for i:=0 to def.paras.count-1 do
write_para(tparavarsym(def.paras[i]));
@ -1412,13 +1404,12 @@ implementation
{ enclosing record takes care of alignment }
{ write params typeinfo }
for i:=0 to def.paras.count-1 do
if not(vo_is_hidden_para in tparavarsym(def.paras[i]).varoptions) then
begin
if is_open_array(tparavarsym(def.paras[i]).vardef) or is_array_of_const(tparavarsym(def.paras[i]).vardef) then
write_rtti_reference(tcb,tarraydef(tparavarsym(def.paras[i]).vardef).elementdef,fullrtti)
else
write_rtti_reference(tcb,tparavarsym(def.paras[i]).vardef,fullrtti);
end;
begin
if is_open_array(tparavarsym(def.paras[i]).vardef) or is_array_of_const(tparavarsym(def.paras[i]).vardef) then
write_rtti_reference(tcb,tarraydef(tparavarsym(def.paras[i]).vardef).elementdef,fullrtti)
else
write_rtti_reference(tcb,tparavarsym(def.paras[i]).vardef,fullrtti);
end;
tcb.end_anonymous_record;
end
else
@ -1436,7 +1427,7 @@ implementation
{ write result typeinfo }
write_rtti_reference(tcb,def.returndef,fullrtti);
{ write parameter count }
tcb.emit_ord_const(def.maxparacount,u8inttype);
tcb.emit_ord_const(def.paras.count,u8inttype);
for i:=0 to def.paras.count-1 do
write_procedure_param(tparavarsym(def.paras[i]));
tcb.end_anonymous_record;

View File

@ -643,7 +643,8 @@ implementation
(
(right.nodetype=arrayconstructorn) and
(right.resultdef.typ=arraydef) and
(tarraydef(right.resultdef).elementdef=voidtype)
(tarraydef(right.resultdef).elementdef=voidtype) and
tarrayconstructornode(right).isempty
)
) then
begin

View File

@ -185,7 +185,7 @@ Unit rax64att;
Consume(AS_COMMA);
hnum:=BuildConstExpression(false,false);
if (hnum<0) or (hnum>maxoffset[actsehdirective=ash_setframe]) or
((hnum mod modulo[actsehdirective=ash_setframe])<>0) then
((hnum and modulo[actsehdirective=ash_setframe])<>0) then
Message1(asmr_e_bad_seh_directive_offset,sehdirectivestr[actsehdirective])
else
curlist.concat(cai_seh_directive.create_reg_offset(actsehdirective,hreg,hnum));

17
tests/webtbf/tw34355.pp Normal file
View File

@ -0,0 +1,17 @@
{ %fail }
program tw34355;
{$mode objfpc}
procedure AssignArray(const aArray: array of string);
var
myArray: array of string;
S: string;
begin
myArray := [aArray]; // << no compiler error, yet no assignment is executed
Writeln('Length(myArray): ', Length(myArray));
for S in myArray do
Writeln(S);
end;
begin
AssignArray(['abc', 'xyz']);
end.