Browse Source

* make asciinr string long enough for binary char constants as pointed out by Matti Kronman, resolves #20821

git-svn-id: trunk@19782 -
florian 13 years ago
parent
commit
4a79262728
3 changed files with 16 additions and 1 deletions
  1. 1 0
      .gitattributes
  2. 1 1
      compiler/scanner.pas
  3. 14 0
      tests/webtbs/tw20821.pp

+ 1 - 0
.gitattributes

@@ -11943,6 +11943,7 @@ tests/webtbs/tw2069.pp svneol=native#text/plain
 tests/webtbs/tw20690.pp svneol=native#text/pascal
 tests/webtbs/tw2072.pp svneol=native#text/plain
 tests/webtbs/tw20744.pp svneol=native#text/plain
+tests/webtbs/tw20821.pp svneol=native#text/pascal
 tests/webtbs/tw20836.pp svneol=native#text/pascal
 tests/webtbs/tw2109.pp svneol=native#text/plain
 tests/webtbs/tw2110.pp svneol=native#text/plain

+ 1 - 1
compiler/scanner.pas

@@ -3711,7 +3711,7 @@ In case not, the value returned can be arbitrary.
         w : word;
         m       : longint;
         mac     : tmacro;
-        asciinr : string[6];
+        asciinr : string[33];
         iswidestring : boolean;
       label
          exit_label;

+ 14 - 0
tests/webtbs/tw20821.pp

@@ -0,0 +1,14 @@
+program bug;
+
+var
+  b : byte;
+begin
+  b:=170;
+  if b<>Byte(#%10101010) then
+    halt(1);
+  if b<>Byte(%10101010) then
+    halt(1);
+  if b<>Byte(%10101010) then
+    halt(1);
+  WriteLn('Ok');
+end.