浏览代码

* do not crash with an ie on illegal boolean expressions in conditional compilation directives, resolves #25951

git-svn-id: trunk@27676 -
florian 11 年之前
父节点
当前提交
24a9dd43b9
共有 3 个文件被更改,包括 42 次插入0 次删除
  1. 1 0
      .gitattributes
  2. 3 0
      compiler/scanner.pas
  3. 38 0
      tests/webtbf/tw25951.pp

+ 1 - 0
.gitattributes

@@ -12734,6 +12734,7 @@ tests/webtbf/tw25622a.pp svneol=native#text/plain
 tests/webtbf/tw25788.pp svneol=native#text/pascal
 tests/webtbf/tw25788.pp svneol=native#text/pascal
 tests/webtbf/tw25862.pp svneol=native#text/plain
 tests/webtbf/tw25862.pp svneol=native#text/plain
 tests/webtbf/tw25915.pp svneol=native#text/pascal
 tests/webtbf/tw25915.pp svneol=native#text/pascal
+tests/webtbf/tw25951.pp svneol=native#text/pascal
 tests/webtbf/tw2657.pp svneol=native#text/plain
 tests/webtbf/tw2657.pp svneol=native#text/plain
 tests/webtbf/tw2670.pp svneol=native#text/plain
 tests/webtbf/tw2670.pp svneol=native#text/plain
 tests/webtbf/tw2719.pp svneol=native#text/plain
 tests/webtbf/tw2719.pp svneol=native#text/plain

+ 3 - 0
compiler/scanner.pas

@@ -1279,6 +1279,9 @@ type
               if b in pconstset(value.valueptr)^ then
               if b in pconstset(value.valueptr)^ then
                 result:=result+tostr(b)+',';
                 result:=result+tostr(b)+',';
           end;
           end;
+        { error values }
+        constnone:
+          result:='';
         else
         else
           internalerror(2013112801);
           internalerror(2013112801);
       end;
       end;

+ 38 - 0
tests/webtbf/tw25951.pp

@@ -0,0 +1,38 @@
+{ %fail }
+// Mainly used for compiler discovery and turning on global compiler settings.
+// This simplifies vwrdefines.inc maintenance, since vwrdefines.inc is per application, and this one is global
+
+// delphi 2009 related
+
+{$if compilerversion>=20}  //D2009
+   {$define Delphiunicode}
+   {$define has_pointermath}
+{$ifend}
+{$if compilerversion>=21} // D2010
+   {$define has_debugthread}
+   {$define has_bigrtti}
+{$ifend}
+{$if compilerversion>=22} // DXE
+   {$define has_keyboard}
+{$ifend}
+{$if compilerversion>=23} // DXE2..DXE4 (5?)
+   {$define has_globalformatsettings}
+   {$define has_extendedTrect} // ?
+{$ifend}
+
+ {$ifdef has_pointermath}
+   {$pointermath on} // aka FPC emulation
+ {$endif}
+
+// most code nowadays probably won't compile under D2009. And even D2009 might be difficult
+// due to increased generics usage in 20.
+ {$ifndef ver150}{$define inlineon}{$endif} // if not D7, then can use inline. Nicer than version.
+ {$ifndef Delphiunicode}
+   {$define vstoldstring}
+ {$else}
+   {$define newvst}
+   {$define newcomport}
+{$endif}
+
+begin
+end.