mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-07-18 02:55:58 +02:00
+ thlcgobj.location_force_mem now supports LOC_JUMP as well, resolves #40650
This commit is contained in:
parent
728fb7c58c
commit
a75e453c30
@ -4298,6 +4298,7 @@ implementation
|
|||||||
r : treference;
|
r : treference;
|
||||||
forcesize: aint;
|
forcesize: aint;
|
||||||
hregister: TRegister;
|
hregister: TRegister;
|
||||||
|
hl: TAsmLabel;
|
||||||
begin
|
begin
|
||||||
case l.loc of
|
case l.loc of
|
||||||
LOC_FPUREGISTER,
|
LOC_FPUREGISTER,
|
||||||
@ -4331,6 +4332,23 @@ implementation
|
|||||||
l.reference:=r;
|
l.reference:=r;
|
||||||
end;
|
end;
|
||||||
{$endif cpuflags}
|
{$endif cpuflags}
|
||||||
|
LOC_JUMP :
|
||||||
|
begin
|
||||||
|
a_label(list,l.truelabel);
|
||||||
|
tg.gethltemp(list,size,size.size,tt_normal,r);
|
||||||
|
if is_cbool(size) then
|
||||||
|
a_load_const_ref(list,size,-1,r)
|
||||||
|
else
|
||||||
|
a_load_const_ref(list,size,1,r);
|
||||||
|
current_asmdata.getjumplabel(hl);
|
||||||
|
a_jmp_always(list,hl);
|
||||||
|
a_label(list,l.falselabel);
|
||||||
|
a_load_const_ref(list,size,0,r);
|
||||||
|
a_label(list,hl);
|
||||||
|
|
||||||
|
location_reset_ref(l,LOC_REFERENCE,l.size,size.alignment,[]);
|
||||||
|
l.reference:=r;
|
||||||
|
end;
|
||||||
LOC_CONSTANT,
|
LOC_CONSTANT,
|
||||||
LOC_REGISTER,
|
LOC_REGISTER,
|
||||||
LOC_CREGISTER,
|
LOC_CREGISTER,
|
||||||
|
14
tests/webtbs/tw40650.pp
Normal file
14
tests/webtbs/tw40650.pp
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
{$coperators+}
|
||||||
|
{$modeswitch arrayoperators}
|
||||||
|
|
||||||
|
var
|
||||||
|
bools: array of boolean;
|
||||||
|
s: string;
|
||||||
|
|
||||||
|
begin
|
||||||
|
bools := [];
|
||||||
|
s := 'x';
|
||||||
|
bools += [(s <> '') and (s[1] = 'x')]; // project1.lpr(9,40) Error: Internal error 2011010304
|
||||||
|
if not(bools[0]) then
|
||||||
|
halt(1);
|
||||||
|
end.
|
Loading…
Reference in New Issue
Block a user