mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-22 12:09:25 +02:00
# revisions: 44598,45635,45757,45764,45772
git-svn-id: branches/fixes_3_2@45849 -
This commit is contained in:
parent
bd4f2057e5
commit
775567e8f7
4
.gitattributes
vendored
4
.gitattributes
vendored
@ -17626,6 +17626,7 @@ tests/webtbs/tw36698.pp -text svneol=native#text/pascal
|
|||||||
tests/webtbs/tw3676.pp svneol=native#text/plain
|
tests/webtbs/tw3676.pp svneol=native#text/plain
|
||||||
tests/webtbs/tw3681.pp svneol=native#text/plain
|
tests/webtbs/tw3681.pp svneol=native#text/plain
|
||||||
tests/webtbs/tw3683.pp svneol=native#text/plain
|
tests/webtbs/tw3683.pp svneol=native#text/plain
|
||||||
|
tests/webtbs/tw36863.pp svneol=native#text/pascal
|
||||||
tests/webtbs/tw3687.pp svneol=native#text/plain
|
tests/webtbs/tw3687.pp svneol=native#text/plain
|
||||||
tests/webtbs/tw3691.pp svneol=native#text/plain
|
tests/webtbs/tw3691.pp svneol=native#text/plain
|
||||||
tests/webtbs/tw36934.pp svneol=native#text/plain
|
tests/webtbs/tw36934.pp svneol=native#text/plain
|
||||||
@ -17636,9 +17637,12 @@ tests/webtbs/tw3700.pp svneol=native#text/plain
|
|||||||
tests/webtbs/tw3708.pp svneol=native#text/plain
|
tests/webtbs/tw3708.pp svneol=native#text/plain
|
||||||
tests/webtbs/tw37095.pp svneol=native#text/plain
|
tests/webtbs/tw37095.pp svneol=native#text/plain
|
||||||
tests/webtbs/tw37095d/uw37095.pp svneol=native#text/plain
|
tests/webtbs/tw37095d/uw37095.pp svneol=native#text/plain
|
||||||
|
tests/webtbs/tw37154.pp svneol=native#text/pascal
|
||||||
tests/webtbs/tw3719.pp svneol=native#text/plain
|
tests/webtbs/tw3719.pp svneol=native#text/plain
|
||||||
tests/webtbs/tw3721.pp svneol=native#text/plain
|
tests/webtbs/tw3721.pp svneol=native#text/plain
|
||||||
tests/webtbs/tw37228.pp svneol=native#text/plain
|
tests/webtbs/tw37228.pp svneol=native#text/plain
|
||||||
|
tests/webtbs/tw37322.pp svneol=native#text/pascal
|
||||||
|
tests/webtbs/tw37323.pp svneol=native#text/pascal
|
||||||
tests/webtbs/tw3742.pp svneol=native#text/plain
|
tests/webtbs/tw3742.pp svneol=native#text/plain
|
||||||
tests/webtbs/tw3751.pp svneol=native#text/plain
|
tests/webtbs/tw3751.pp svneol=native#text/plain
|
||||||
tests/webtbs/tw3758.pp svneol=native#text/plain
|
tests/webtbs/tw3758.pp svneol=native#text/plain
|
||||||
|
@ -437,23 +437,30 @@ implementation
|
|||||||
{ can't hardcode the position of the '$', e.g. on darwin an underscore
|
{ can't hardcode the position of the '$', e.g. on darwin an underscore
|
||||||
is added }
|
is added }
|
||||||
hashedid.id:=copy(defaultname,2,255);
|
hashedid.id:=copy(defaultname,2,255);
|
||||||
{ the default sym is always part of the current procedure/function }
|
{ in case of a previous error, current_procinfo might not be set
|
||||||
srsymtable:=current_procinfo.procdef.localst;
|
so avoid a crash in this case }
|
||||||
srsym:=tsym(srsymtable.findwithhash(hashedid));
|
if assigned(current_procinfo) then
|
||||||
if not assigned(srsym) then
|
|
||||||
begin
|
begin
|
||||||
{ no valid default variable found, so create it }
|
{ the default sym is always part of the current procedure/function }
|
||||||
srsym:=clocalvarsym.create(defaultname,vs_const,def,[]);
|
srsymtable:=current_procinfo.procdef.localst;
|
||||||
srsymtable.insert(srsym);
|
srsym:=tsym(srsymtable.findwithhash(hashedid));
|
||||||
{ mark the staticvarsym as typedconst }
|
if not assigned(srsym) then
|
||||||
include(tabstractvarsym(srsym).varoptions,vo_is_typed_const);
|
begin
|
||||||
include(tabstractvarsym(srsym).varoptions,vo_is_default_var);
|
{ no valid default variable found, so create it }
|
||||||
{ The variable has a value assigned }
|
srsym:=clocalvarsym.create(defaultname,vs_const,def,[]);
|
||||||
tabstractvarsym(srsym).varstate:=vs_initialised;
|
srsymtable.insert(srsym);
|
||||||
{ the variable can't be placed in a register }
|
{ mark the staticvarsym as typedconst }
|
||||||
tabstractvarsym(srsym).varregable:=vr_none;
|
include(tabstractvarsym(srsym).varoptions,vo_is_typed_const);
|
||||||
end;
|
include(tabstractvarsym(srsym).varoptions,vo_is_default_var);
|
||||||
result:=cloadnode.create(srsym,srsymtable);
|
{ The variable has a value assigned }
|
||||||
|
tabstractvarsym(srsym).varstate:=vs_initialised;
|
||||||
|
{ the variable can't be placed in a register }
|
||||||
|
tabstractvarsym(srsym).varregable:=vr_none;
|
||||||
|
end;
|
||||||
|
result:=cloadnode.create(srsym,srsymtable);
|
||||||
|
end
|
||||||
|
else
|
||||||
|
result:=cerrornode.create;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
var
|
var
|
||||||
|
@ -610,13 +610,21 @@ implementation
|
|||||||
|
|
||||||
block:=nil;
|
block:=nil;
|
||||||
stat:=nil;
|
stat:=nil;
|
||||||
|
self_temp:=nil;
|
||||||
if docheck then
|
if docheck then
|
||||||
begin
|
begin
|
||||||
{ check for nil self-pointer }
|
{ check for nil self-pointer }
|
||||||
block:=internalstatements(stat);
|
block:=internalstatements(stat);
|
||||||
self_temp:=ctempcreatenode.create_value(
|
if is_object(self_resultdef) then
|
||||||
self_resultdef,self_resultdef.size,tt_persistent,true,
|
begin
|
||||||
self_node);
|
self_temp:=ctempcreatenode.create_value(
|
||||||
|
cpointerdef.getreusable(self_resultdef),cpointerdef.getreusable(self_resultdef).size,tt_persistent,true,
|
||||||
|
caddrnode.create(self_node));
|
||||||
|
end
|
||||||
|
else
|
||||||
|
self_temp:=ctempcreatenode.create_value(
|
||||||
|
self_resultdef,self_resultdef.size,tt_persistent,true,
|
||||||
|
self_node);
|
||||||
addstatement(stat,self_temp);
|
addstatement(stat,self_temp);
|
||||||
|
|
||||||
{ in case of an object, self can only be nil if it's a dereferenced
|
{ in case of an object, self can only be nil if it's a dereferenced
|
||||||
@ -626,8 +634,6 @@ implementation
|
|||||||
(actualtargetnode(@self_node)^.nodetype=derefn) then
|
(actualtargetnode(@self_node)^.nodetype=derefn) then
|
||||||
begin
|
begin
|
||||||
check_self:=ctemprefnode.create(self_temp);
|
check_self:=ctemprefnode.create(self_temp);
|
||||||
if is_object(self_resultdef) then
|
|
||||||
check_self:=caddrnode.create(check_self);
|
|
||||||
addstatement(stat,cifnode.create(
|
addstatement(stat,cifnode.create(
|
||||||
caddnode.create(equaln,
|
caddnode.create(equaln,
|
||||||
ctypeconvnode.create_explicit(
|
ctypeconvnode.create_explicit(
|
||||||
@ -639,8 +645,10 @@ implementation
|
|||||||
nil)
|
nil)
|
||||||
);
|
);
|
||||||
end;
|
end;
|
||||||
addstatement(stat,ctempdeletenode.create_normal_temp(self_temp));
|
if is_object(self_resultdef) then
|
||||||
self_node:=ctemprefnode.create(self_temp);
|
self_node:=cderefnode.create(ctemprefnode.create(self_temp))
|
||||||
|
else
|
||||||
|
self_node:=ctemprefnode.create(self_temp)
|
||||||
end;
|
end;
|
||||||
{ in case of a classref, the "instance" is a pointer
|
{ in case of a classref, the "instance" is a pointer
|
||||||
to pointer to a VMT and there is no vmt field }
|
to pointer to a VMT and there is no vmt field }
|
||||||
@ -690,6 +698,7 @@ implementation
|
|||||||
)
|
)
|
||||||
);
|
);
|
||||||
addstatement(stat,ctempdeletenode.create_normal_temp(vmt_temp));
|
addstatement(stat,ctempdeletenode.create_normal_temp(vmt_temp));
|
||||||
|
addstatement(stat,ctempdeletenode.create(self_temp));
|
||||||
addstatement(stat,ctemprefnode.create(vmt_temp));
|
addstatement(stat,ctemprefnode.create(vmt_temp));
|
||||||
result:=block;
|
result:=block;
|
||||||
end
|
end
|
||||||
|
@ -360,7 +360,14 @@ implementation
|
|||||||
if token=_ID then
|
if token=_ID then
|
||||||
labelsym:=clabelsym.create(orgpattern)
|
labelsym:=clabelsym.create(orgpattern)
|
||||||
else
|
else
|
||||||
labelsym:=clabelsym.create(pattern);
|
begin
|
||||||
|
{ strip leading 0's in iso mode }
|
||||||
|
if (([m_iso,m_extpas]*current_settings.modeswitches)<>[]) then
|
||||||
|
while pattern[1]='0' do
|
||||||
|
delete(pattern,1,1);
|
||||||
|
labelsym:=clabelsym.create(pattern);
|
||||||
|
end;
|
||||||
|
|
||||||
symtablestack.top.insert(labelsym);
|
symtablestack.top.insert(labelsym);
|
||||||
if m_non_local_goto in current_settings.modeswitches then
|
if m_non_local_goto in current_settings.modeswitches then
|
||||||
begin
|
begin
|
||||||
|
@ -2553,6 +2553,8 @@ implementation
|
|||||||
HideSym(hsym);
|
HideSym(hsym);
|
||||||
tstaticvarsym(sym).isoindex:=tprogramparasym(hsym).isoindex;
|
tstaticvarsym(sym).isoindex:=tprogramparasym(hsym).isoindex;
|
||||||
end
|
end
|
||||||
|
else if (m_iso in current_settings.modeswitches) and (hsym.typ=unitsym) then
|
||||||
|
HideSym(hsym)
|
||||||
else
|
else
|
||||||
DuplicateSym(hashedid,sym,hsym,false);
|
DuplicateSym(hashedid,sym,hsym,false);
|
||||||
result:=true;
|
result:=true;
|
||||||
|
@ -1457,7 +1457,7 @@ begin
|
|||||||
end;
|
end;
|
||||||
if TextRec(f).BufPos>=TextRec(f).BufEnd Then
|
if TextRec(f).BufPos>=TextRec(f).BufEnd Then
|
||||||
FileFunc(TextRec(f).InOutFunc)(TextRec(f));
|
FileFunc(TextRec(f).InOutFunc)(TextRec(f));
|
||||||
CheckRead:=True;
|
CheckRead:=InOutRes=0;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
@ -1991,11 +1991,15 @@ var
|
|||||||
hs : String;
|
hs : String;
|
||||||
code : ValSInt;
|
code : ValSInt;
|
||||||
Begin
|
Begin
|
||||||
ReadInteger(f,hs);
|
l:=0;
|
||||||
|
if not CheckRead(f) then
|
||||||
|
Exit;
|
||||||
|
|
||||||
Val(hs,l,code);
|
ReadInteger(f,hs);
|
||||||
if Code <> 0 then
|
|
||||||
InOutRes:=106;
|
Val(hs,l,code);
|
||||||
|
if Code <> 0 then
|
||||||
|
InOutRes:=106;
|
||||||
End;
|
End;
|
||||||
|
|
||||||
|
|
||||||
@ -2031,10 +2035,14 @@ var
|
|||||||
hs : String;
|
hs : String;
|
||||||
code : ValSInt;
|
code : ValSInt;
|
||||||
Begin
|
Begin
|
||||||
ReadInteger(f,hs);
|
u:=0;
|
||||||
Val(hs,u,code);
|
if not CheckRead(f) then
|
||||||
If code<>0 Then
|
Exit;
|
||||||
InOutRes:=106;
|
|
||||||
|
ReadInteger(f,hs);
|
||||||
|
Val(hs,u,code);
|
||||||
|
If code<>0 Then
|
||||||
|
InOutRes:=106;
|
||||||
End;
|
End;
|
||||||
|
|
||||||
|
|
||||||
@ -2067,6 +2075,10 @@ var
|
|||||||
hs : string;
|
hs : string;
|
||||||
code : Word;
|
code : Word;
|
||||||
begin
|
begin
|
||||||
|
v:=0.0;
|
||||||
|
if not CheckRead(f) then
|
||||||
|
Exit;
|
||||||
|
|
||||||
ReadReal(f,hs);
|
ReadReal(f,hs);
|
||||||
Val(hs,v,code);
|
Val(hs,v,code);
|
||||||
If code<>0 Then
|
If code<>0 Then
|
||||||
@ -2127,6 +2139,10 @@ var
|
|||||||
hs : string;
|
hs : string;
|
||||||
code : ValSInt;
|
code : ValSInt;
|
||||||
begin
|
begin
|
||||||
|
v:=0.0;
|
||||||
|
if not CheckRead(f) then
|
||||||
|
Exit;
|
||||||
|
|
||||||
ReadReal(f,hs);
|
ReadReal(f,hs);
|
||||||
Val(hs,v,code);
|
Val(hs,v,code);
|
||||||
If code<>0 Then
|
If code<>0 Then
|
||||||
@ -2163,10 +2179,14 @@ var
|
|||||||
hs : String;
|
hs : String;
|
||||||
code : longint;
|
code : longint;
|
||||||
Begin
|
Begin
|
||||||
ReadInteger(f,hs);
|
q:=0;
|
||||||
Val(hs,q,code);
|
if not CheckRead(f) then
|
||||||
If code<>0 Then
|
Exit;
|
||||||
InOutRes:=106;
|
|
||||||
|
ReadInteger(f,hs);
|
||||||
|
Val(hs,q,code);
|
||||||
|
If code<>0 Then
|
||||||
|
InOutRes:=106;
|
||||||
End;
|
End;
|
||||||
|
|
||||||
procedure fpc_Read_Text_Int64(var f : text; out i : int64); iocheck; compilerproc;
|
procedure fpc_Read_Text_Int64(var f : text; out i : int64); iocheck; compilerproc;
|
||||||
@ -2196,10 +2216,14 @@ var
|
|||||||
hs : String;
|
hs : String;
|
||||||
code : Longint;
|
code : Longint;
|
||||||
Begin
|
Begin
|
||||||
ReadInteger(f,hs);
|
l:=0;
|
||||||
Val(hs,i,code);
|
if not CheckRead(f) then
|
||||||
If code<>0 Then
|
Exit;
|
||||||
InOutRes:=106;
|
|
||||||
|
ReadInteger(f,hs);
|
||||||
|
Val(hs,i,code);
|
||||||
|
If code<>0 Then
|
||||||
|
InOutRes:=106;
|
||||||
End;
|
End;
|
||||||
|
|
||||||
|
|
||||||
|
30
tests/webtbs/tw36863.pp
Normal file
30
tests/webtbs/tw36863.pp
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
{ %OPT=-Ct -CR }
|
||||||
|
{$M 65536,65536}
|
||||||
|
|
||||||
|
type
|
||||||
|
TObj = object
|
||||||
|
v: array [0..$2000] of Byte;
|
||||||
|
procedure Proc(depth: Integer);
|
||||||
|
procedure VProc; virtual;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TObj.VProc;
|
||||||
|
begin
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TObj.Proc(depth: Integer);
|
||||||
|
begin
|
||||||
|
{stack is eaten here on the function entry}
|
||||||
|
if (depth < 64) then
|
||||||
|
Proc(depth+1);
|
||||||
|
{do not actually call the method since the obj is not initialized, just for minimal demonstration}
|
||||||
|
if (depth < 0) then
|
||||||
|
VProc;
|
||||||
|
end;
|
||||||
|
|
||||||
|
var
|
||||||
|
Obj: TObj;
|
||||||
|
begin
|
||||||
|
Obj.Proc(0);
|
||||||
|
writeln('Completed');
|
||||||
|
end.
|
11
tests/webtbs/tw37154.pp
Normal file
11
tests/webtbs/tw37154.pp
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
{ %RESULT=6 }
|
||||||
|
{$mode ISO}
|
||||||
|
program isoModeReadingNumbers(input, output);
|
||||||
|
var
|
||||||
|
i: integer;
|
||||||
|
begin
|
||||||
|
{ we cannot call the executable with <&- >&- while running the test suite,
|
||||||
|
so render the file handle manually illegal }
|
||||||
|
Textrec(input).handle:=$1234;
|
||||||
|
readLn(i);
|
||||||
|
end.
|
7
tests/webtbs/tw37322.pp
Normal file
7
tests/webtbs/tw37322.pp
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
{ %OPT=-Miso }
|
||||||
|
program test;
|
||||||
|
|
||||||
|
var test: integer;
|
||||||
|
|
||||||
|
begin
|
||||||
|
end.
|
9
tests/webtbs/tw37323.pp
Normal file
9
tests/webtbs/tw37323.pp
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
{ %OPT=-Miso -Sg }
|
||||||
|
program test;
|
||||||
|
|
||||||
|
label 0001;
|
||||||
|
|
||||||
|
begin
|
||||||
|
goto 1;
|
||||||
|
1:
|
||||||
|
end.
|
Loading…
Reference in New Issue
Block a user