mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-10-30 18:35:04 +01:00
* Fixed release problem and except (reported by Seth Grover)
git-svn-id: trunk@21922 -
This commit is contained in:
parent
5e93f6b70f
commit
a4be3f17d7
@ -1292,6 +1292,7 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TPasElement.Release;
|
procedure TPasElement.Release;
|
||||||
|
|
||||||
begin
|
begin
|
||||||
if FRefCount = 0 then
|
if FRefCount = 0 then
|
||||||
Free
|
Free
|
||||||
@ -1808,7 +1809,10 @@ procedure TPasImplForLoop.AddElement(Element: TPasImplElement);
|
|||||||
begin
|
begin
|
||||||
inherited AddElement(Element);
|
inherited AddElement(Element);
|
||||||
if Body=nil then
|
if Body=nil then
|
||||||
Body:=Element
|
begin
|
||||||
|
Body:=Element;
|
||||||
|
Body.AddRef;
|
||||||
|
end
|
||||||
else
|
else
|
||||||
raise Exception.Create('TPasImplForLoop.AddElement body already set - please report this bug');
|
raise Exception.Create('TPasImplForLoop.AddElement body already set - please report this bug');
|
||||||
end;
|
end;
|
||||||
|
|||||||
@ -3038,7 +3038,7 @@ begin
|
|||||||
end;
|
end;
|
||||||
tkIf:
|
tkIf:
|
||||||
begin
|
begin
|
||||||
Condition:=ParseExpression(Parent);
|
Condition:=ParseExpression(CurBlock);
|
||||||
el:=TPasImplIfElse(CreateElement(TPasImplIfElse,'',CurBlock));
|
el:=TPasImplIfElse(CreateElement(TPasImplIfElse,'',CurBlock));
|
||||||
TPasImplIfElse(el).Condition:=Condition;
|
TPasImplIfElse(el).Condition:=Condition;
|
||||||
//WriteLn(i,'IF Condition="',Condition,'" Token=',CurTokenText);
|
//WriteLn(i,'IF Condition="',Condition,'" Token=',CurTokenText);
|
||||||
@ -3241,7 +3241,7 @@ begin
|
|||||||
//writeln(i,'EXCEPT');
|
//writeln(i,'EXCEPT');
|
||||||
el:=TPasImplTryExcept(CreateElement(TPasImplTryExcept,'',CurBlock));
|
el:=TPasImplTryExcept(CreateElement(TPasImplTryExcept,'',CurBlock));
|
||||||
TPasImplTry(CurBlock).FinallyExcept:=TPasImplTryExcept(el);
|
TPasImplTry(CurBlock).FinallyExcept:=TPasImplTryExcept(el);
|
||||||
CurBlock.AddElement(el);
|
// CurBlock.AddElement(el);
|
||||||
CurBlock:=TPasImplTryExcept(el);
|
CurBlock:=TPasImplTryExcept(el);
|
||||||
end else
|
end else
|
||||||
ParseExc(SParserSyntaxError);
|
ParseExc(SParserSyntaxError);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user