* changed uses of "exit" in constructors to if/then constructs, to

avoid the constructor result/SSA bug in 2.6.x

git-svn-id: trunk@26651 -
This commit is contained in:
Jonas Maebe 2014-02-02 09:09:51 +00:00
parent 4e9c54278e
commit 6a4afd3a33

View File

@ -159,15 +159,16 @@ function copy_parasize(var n: tnode; arg: pointer): foreachnoderesult;
constructor tx64tryfinallynode.create(l, r: TNode); constructor tx64tryfinallynode.create(l, r: TNode);
begin begin
inherited create(l,r); inherited create(l,r);
if (target_info.system<>system_x86_64_win64) or ( if (target_info.system=system_x86_64_win64) and
(
{ Don't create child procedures for generic methods, their nested-like { Don't create child procedures for generic methods, their nested-like
behavior causes compilation errors because real nested procedures behavior causes compilation errors because real nested procedures
aren't allowed for generics. Not creating them doesn't harm because aren't allowed for generics. Not creating them doesn't harm because
generic node tree is discarded without generating code. } generic node tree is discarded without generating code. }
assigned(current_procinfo.procdef.struct) and not assigned(current_procinfo.procdef.struct) or
(df_generic in current_procinfo.procdef.struct.defoptions) not(df_generic in current_procinfo.procdef.struct.defoptions)
) then ) then
exit; begin
finalizepi:=tcgprocinfo(cprocinfo.create(current_procinfo)); finalizepi:=tcgprocinfo(cprocinfo.create(current_procinfo));
finalizepi.force_nested; finalizepi.force_nested;
finalizepi.procdef:=create_finalizer_procdef; finalizepi.procdef:=create_finalizer_procdef;
@ -181,13 +182,13 @@ constructor tx64tryfinallynode.create(l, r: TNode);
temps may be still placed into registers. This must be fixed. } temps may be still placed into registers. This must be fixed. }
foreachnodestatic(r,@reset_regvars,finalizepi); foreachnodestatic(r,@reset_regvars,finalizepi);
end; end;
end;
constructor tx64tryfinallynode.create_implicit(l, r, _t1: TNode); constructor tx64tryfinallynode.create_implicit(l, r, _t1: TNode);
begin begin
inherited create_implicit(l, r, _t1); inherited create_implicit(l, r, _t1);
if (target_info.system<>system_x86_64_win64) then if (target_info.system=system_x86_64_win64) then
exit; begin
if assigned(current_procinfo.procdef.struct) and if assigned(current_procinfo.procdef.struct) and
(df_generic in current_procinfo.procdef.struct.defoptions) then (df_generic in current_procinfo.procdef.struct.defoptions) then
InternalError(2013012501); InternalError(2013012501);
@ -205,6 +206,7 @@ constructor tx64tryfinallynode.create_implicit(l, r, _t1: TNode);
include(finalizepi.flags,pi_has_assembler_block); include(finalizepi.flags,pi_has_assembler_block);
finalizepi.allocate_push_parasize(32); finalizepi.allocate_push_parasize(32);
end; end;
end;
function tx64tryfinallynode.simplify(forinline: boolean): tnode; function tx64tryfinallynode.simplify(forinline: boolean): tnode;
begin begin