Browse Source

* fix for crash while building LCL docs. Hopefully the last one.
The fix is an emergency fix only, disabling calling convention
registration for element types that not derive from TPasProcedure

The fix is in Parsprocedureorfunctionheader, second part that handles
modifiers and calling conventions. The parent was always typecasted
to TPasProcedure, but can also be TPasProcedureType and TPasFunctionType
that not derive from TPasProcedure.

git-svn-id: trunk@19903 -

marco 13 years ago
parent
commit
7b5c7f81d6
1 changed files with 7 additions and 4 deletions
  1. 7 4
      packages/fcl-passrc/src/pparser.pp

+ 7 - 4
packages/fcl-passrc/src/pparser.pp

@@ -2449,12 +2449,14 @@ begin
     NextToken;
     If isCallingConvention(CurTokenString,cc) then
       begin
-      TPasProcedure(Parent).CallingConvention:=CC;
+        if parent is TPasProcedure then
+          TPasProcedure(Parent).CallingConvention:=CC;
       ExpectToken(tkSemicolon);
       end
     else if IsModifier(CurTokenString,pm) then
       begin
-      TPasProcedure(Parent).AddModifier(pm);
+      if parent is TPasProcedure then
+        TPasProcedure(Parent).AddModifier(pm);
       if pm=pmExternal then
         begin
         NextToken;
@@ -2491,8 +2493,9 @@ begin
           NextToken;
           If CurToken<>tkSemicolon then
             begin
-            TPasProcedure(Parent).MessageName:=CurtokenString;
-            If (CurToken=tkString) then
+            if parent is TPasProcedure then
+              TPasProcedure(Parent).MessageName:=CurtokenString;
+            If (CurToken=tkString) and (parent is TPasProcedure) then
               TPasProcedure(Parent).Messagetype:=pmtString;
             end;
         until CurToken = tkSemicolon;