Browse Source

* fixed internalerror after invalid type node in subscript node
(mantis #22395)

git-svn-id: trunk@21917 -

Jonas Maebe 13 years ago
parent
commit
b1d00b66ac
3 changed files with 16 additions and 2 deletions
  1. 1 0
      .gitattributes
  2. 2 2
      compiler/nld.pas
  3. 13 0
      tests/webtbf/tw22395.pp

+ 1 - 0
.gitattributes

@@ -11674,6 +11674,7 @@ tests/webtbf/tw2174.pp svneol=native#text/plain
 tests/webtbf/tw21873.pp svneol=native#text/plain
 tests/webtbf/tw2209.pp svneol=native#text/plain
 tests/webtbf/tw22219.pp svneol=native#text/pascal
+tests/webtbf/tw22395.pp svneol=native#text/plain
 tests/webtbf/tw2242.pp svneol=native#text/plain
 tests/webtbf/tw2273.pp svneol=native#text/plain
 tests/webtbf/tw2281.pp svneol=native#text/plain

+ 2 - 2
compiler/nld.pas

@@ -1229,9 +1229,9 @@ implementation
            Only when the allowed flag is set we don't generate
            an error }
          if not allowed then
-          Message(parser_e_no_type_not_allowed_here);
+           CGMessage(parser_e_no_type_not_allowed_here);
          if not helperallowed and is_objectpascal_helper(typedef) then
-           Message(parser_e_no_category_as_types);
+           CGMessage(parser_e_no_category_as_types);
       end;
 
 

+ 13 - 0
tests/webtbf/tw22395.pp

@@ -0,0 +1,13 @@
+{ %fail }
+
+program test;
+type
+  trec = record
+    i: int64;
+  end;
+var
+   R: QWord;
+begin
+   R := QWord(trec.i);
+end.
+