瀏覽代碼

* avoid illegal type case for in_ro*_*

florian 4 周之前
父節點
當前提交
30c631b6fa
共有 1 個文件被更改,包括 11 次插入5 次删除
  1. 11 5
      compiler/nutils.pas

+ 11 - 5
compiler/nutils.pas

@@ -986,11 +986,17 @@ implementation
                       begin
                       begin
                         { operation (add, sub, or, and }
                         { operation (add, sub, or, and }
                         inc(cv);
                         inc(cv);
-                        { left expression }
-                        inc(cv,node_complexity(tcallparanode(tunarynode(p).left).left));
-                        p:=tcallparanode(tunarynode(p).left).right;
-                        if assigned(p) then
-                          p:=tcallparanode(p).left;
+                        { rox_x has no call para node, so check for this }
+                        if tunarynode(p).left.nodetype=callparan then
+                          begin
+                            { left expression }
+                            inc(cv,node_complexity(tcallparanode(tunarynode(p).left).left));
+                            p:=tcallparanode(tunarynode(p).left).right;
+                            if assigned(p) then
+                              p:=tcallparanode(p).left;
+                          end
+                        else
+                          p:=tunarynode(p).left;
                       end;
                       end;
                     else
                     else
                       exit;
                       exit;