浏览代码

* allow multiple passes on as nodes

git-svn-id: trunk@29741 -
florian 10 年之前
父节点
当前提交
aafec52a52
共有 1 个文件被更改,包括 6 次插入1 次删除
  1. 6 1
      compiler/ncnv.pas

+ 6 - 1
compiler/ncnv.pas

@@ -4071,8 +4071,13 @@ implementation
         result:=nil;
         result:=nil;
         { Passing a class type to an "as" expression cannot result in a class
         { Passing a class type to an "as" expression cannot result in a class
           of that type to be constructed.
           of that type to be constructed.
+
+          We could put this inside the if-block below, but this way it is
+          safe for sure even if the code below changes
         }
         }
-        include(right.flags,nf_ignore_for_wpo);
+        if assigned(right) then
+          include(right.flags,nf_ignore_for_wpo);
+
         if not assigned(call) then
         if not assigned(call) then
           begin
           begin
             if is_class(left.resultdef) and
             if is_class(left.resultdef) and