Browse Source

Avoid wrong typecast in DoReplace function as revealed by extcycle

git-svn-id: trunk@22376 -
pierre 13 years ago
parent
commit
fd844d08e0
1 changed files with 2 additions and 1 deletions
  1. 2 1
      compiler/ncgutil.pas

+ 2 - 1
compiler/ncgutil.pas

@@ -1739,7 +1739,8 @@ implementation
         case n.nodetype of
         case n.nodetype of
           loadn:
           loadn:
             begin
             begin
-              if (tabstractvarsym(tloadnode(n).symtableentry).varoptions * [vo_is_dll_var, vo_is_thread_var] = []) and
+              if tloadnode(n).symtableentry.inheritsfrom(tabstractvarsym) and
+                 (tabstractvarsym(tloadnode(n).symtableentry).varoptions * [vo_is_dll_var, vo_is_thread_var] = []) and
                  not assigned(tloadnode(n).left) and
                  not assigned(tloadnode(n).left) and
                  ((tloadnode(n).symtableentry <> rr^.ressym) or
                  ((tloadnode(n).symtableentry <> rr^.ressym) or
                   not(fc_exit in flowcontrol)
                   not(fc_exit in flowcontrol)