Browse Source

* fix invalid typecast

git-svn-id: trunk@8435 -
peter 18 years ago
parent
commit
0fda1126b5
1 changed files with 2 additions and 1 deletions
  1. 2 1
      compiler/nld.pas

+ 2 - 1
compiler/nld.pas

@@ -560,7 +560,8 @@ implementation
                      (tstringconstnode(right).len > tstringdef(left.resultdef).len) then
                      (tstringconstnode(right).len > tstringdef(left.resultdef).len) then
                      cgmessage(type_w_string_too_long);
                      cgmessage(type_w_string_too_long);
                   inserttypeconv(right,left.resultdef);
                   inserttypeconv(right,left.resultdef);
-                  if (tstringconstnode(right).len=0) then
+                  if (right.nodetype=stringconstn) and
+                     (tstringconstnode(right).len=0) then
                     useshelper:=false;
                     useshelper:=false;
                 end;
                 end;
              { rest is done in pass 1 (JM) }
              { rest is done in pass 1 (JM) }