mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-12-04 18:07:13 +01:00
* handle loc_jump/loc_flags in for-loop upper bound (mantis #15169)
git-svn-id: trunk@14261 -
This commit is contained in:
parent
2c3c6d27d3
commit
d644fc87a1
1
.gitattributes
vendored
1
.gitattributes
vendored
@ -10090,6 +10090,7 @@ tests/webtbs/tw14958a.pp svneol=native#text/plain
|
||||
tests/webtbs/tw14958b.pp svneol=native#text/plain
|
||||
tests/webtbs/tw1501.pp svneol=native#text/plain
|
||||
tests/webtbs/tw15088.pp svneol=native#text/plain
|
||||
tests/webtbs/tw15169.pp svneol=native#text/plain
|
||||
tests/webtbs/tw1532.pp svneol=native#text/plain
|
||||
tests/webtbs/tw1539.pp svneol=native#text/plain
|
||||
tests/webtbs/tw1567.pp svneol=native#text/plain
|
||||
|
||||
@ -424,7 +424,8 @@ implementation
|
||||
|
||||
procedure tcgfornode.pass_generate_code;
|
||||
var
|
||||
l3,oldclabel,oldblabel : tasmlabel;
|
||||
l3,oldclabel,oldblabel,
|
||||
otl, ofl : tasmlabel;
|
||||
temptovalue : boolean;
|
||||
hop : topcg;
|
||||
hcond : topcmp;
|
||||
@ -433,6 +434,7 @@ implementation
|
||||
cmp_const:Tconstexprint;
|
||||
oldflowcontrol : tflowcontrol;
|
||||
oldexecutionweight : longint;
|
||||
isjump: boolean;
|
||||
begin
|
||||
location_reset(location,LOC_VOID,OS_NO);
|
||||
oldclabel:=current_procinfo.CurrContinueLabel;
|
||||
@ -454,7 +456,22 @@ implementation
|
||||
}
|
||||
and not(assigned(entrylabel));
|
||||
|
||||
secondpass(t1);
|
||||
isjump:=(t1.expectloc=LOC_JUMP);
|
||||
if isjump then
|
||||
begin
|
||||
otl:=current_procinfo.CurrTrueLabel;
|
||||
current_asmdata.getjumplabel(current_procinfo.CurrTrueLabel);
|
||||
ofl:=current_procinfo.CurrFalseLabel;
|
||||
current_asmdata.getjumplabel(current_procinfo.CurrFalseLabel);
|
||||
end;
|
||||
secondpass(t1);
|
||||
if t1.location.loc in [LOC_FLAGS,LOC_JUMP] then
|
||||
location_force_reg(current_asmdata.CurrAsmList,t1.location,def_cgsize(t1.resultdef),false);
|
||||
if isjump then
|
||||
begin
|
||||
current_procinfo.CurrTrueLabel:=otl;
|
||||
current_procinfo.CurrFalseLabel:=ofl;
|
||||
end;
|
||||
{ calculate pointer value and check if changeable and if so }
|
||||
{ load into temporary variable }
|
||||
if t1.nodetype<>ordconstn then
|
||||
|
||||
17
tests/webtbs/tw15169.pp
Normal file
17
tests/webtbs/tw15169.pp
Normal file
@ -0,0 +1,17 @@
|
||||
|
||||
type
|
||||
TDragHandleStyle = (dhDouble, dhNone, dhSingle);
|
||||
|
||||
|
||||
var b : boolean;
|
||||
fdraghandlestyle : TDraghandlestyle;
|
||||
i : longint;
|
||||
begin
|
||||
i:=0;
|
||||
FDraghandlestyle:=dhDouble;
|
||||
for B := False to (FDragHandleStyle = dhDouble) do
|
||||
inc(i);
|
||||
if (i<>2) then
|
||||
halt(1);
|
||||
end.
|
||||
|
||||
Loading…
Reference in New Issue
Block a user