* Fixed release problem and except (reported by Seth Grover)

git-svn-id: trunk@21922 -
This commit is contained in:
michael 2012-07-16 20:52:22 +00:00
parent 5e93f6b70f
commit a4be3f17d7
2 changed files with 7 additions and 3 deletions

View File

@ -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;

View File

@ -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);