mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-10-24 21:31:37 +02: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;
|
||||
|
||||
procedure TPasElement.Release;
|
||||
|
||||
begin
|
||||
if FRefCount = 0 then
|
||||
Free
|
||||
@ -1808,7 +1809,10 @@ procedure TPasImplForLoop.AddElement(Element: TPasImplElement);
|
||||
begin
|
||||
inherited AddElement(Element);
|
||||
if Body=nil then
|
||||
Body:=Element
|
||||
begin
|
||||
Body:=Element;
|
||||
Body.AddRef;
|
||||
end
|
||||
else
|
||||
raise Exception.Create('TPasImplForLoop.AddElement body already set - please report this bug');
|
||||
end;
|
||||
|
||||
@ -3038,7 +3038,7 @@ begin
|
||||
end;
|
||||
tkIf:
|
||||
begin
|
||||
Condition:=ParseExpression(Parent);
|
||||
Condition:=ParseExpression(CurBlock);
|
||||
el:=TPasImplIfElse(CreateElement(TPasImplIfElse,'',CurBlock));
|
||||
TPasImplIfElse(el).Condition:=Condition;
|
||||
//WriteLn(i,'IF Condition="',Condition,'" Token=',CurTokenText);
|
||||
@ -3241,7 +3241,7 @@ begin
|
||||
//writeln(i,'EXCEPT');
|
||||
el:=TPasImplTryExcept(CreateElement(TPasImplTryExcept,'',CurBlock));
|
||||
TPasImplTry(CurBlock).FinallyExcept:=TPasImplTryExcept(el);
|
||||
CurBlock.AddElement(el);
|
||||
// CurBlock.AddElement(el);
|
||||
CurBlock:=TPasImplTryExcept(el);
|
||||
end else
|
||||
ParseExc(SParserSyntaxError);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user