浏览代码

* fixed crash when compiling certain invalid "in" constructions
(mantis 8031)

git-svn-id: trunk@5748 -

Jonas Maebe 18 年之前
父节点
当前提交
b86e2aa33a
共有 3 个文件被更改,包括 14 次插入0 次删除
  1. 1 0
      .gitattributes
  2. 3 0
      compiler/nset.pas
  3. 10 0
      tests/webtbf/tw8031.pp

+ 1 - 0
.gitattributes

@@ -7168,6 +7168,7 @@ tests/webtbf/tw7438.pp svneol=native#text/plain
 tests/webtbf/tw7438a.pp svneol=native#text/plain
 tests/webtbf/tw7989.pp svneol=native#text/plain
 tests/webtbf/tw8019.pp svneol=native#text/plain
+tests/webtbf/tw8031.pp svneol=native#text/plain
 tests/webtbf/uw0744.pp svneol=native#text/plain
 tests/webtbf/uw0840a.pp svneol=native#text/plain
 tests/webtbf/uw0840b.pp svneol=native#text/plain

+ 3 - 0
compiler/nset.pas

@@ -219,6 +219,9 @@ implementation
          if right.resultdef.typ<>setdef then
            CGMessage(sym_e_set_expected);
 
+         if codegenerror then
+           exit;
+
          if (right.nodetype=typen) then
            begin
              { we need to create a setconstn }

+ 10 - 0
tests/webtbf/tw8031.pp

@@ -0,0 +1,10 @@
+{ %fail }
+
+program text;
+
+type TSQLDBTypes = (mysql40,mysql41,mysql50,postgresql,interbase,odbc,oracle);
+const MySQLdbTypes = [mysql40,mysql41,mysql50];
+
+begin
+  if (SQLDbType in TSQLDBTypes) then writeln('strange');
+end.