Pārlūkot izejas kodu

* 0 is a valid label in iso mode, resolves #37428

git-svn-id: trunk@46362 -
(cherry picked from commit 6dac888ae5f3ff333d12ba8ecb17c124329342b5)
florian 5 gadi atpakaļ
vecāks
revīzija
b6ccf16c9d
3 mainītis faili ar 10 papildinājumiem un 2 dzēšanām
  1. 1 1
      compiler/pdecl.pas
  2. 1 1
      compiler/pstatmnt.pas
  3. 8 0
      tests/webtbs/tw37428.pp

+ 1 - 1
compiler/pdecl.pas

@@ -363,7 +363,7 @@ implementation
                   begin
                     { strip leading 0's in iso mode }
                     if (([m_iso,m_extpas]*current_settings.modeswitches)<>[]) then
-                      while pattern[1]='0' do
+                      while (length(pattern)>1) and (pattern[1]='0') do
                         delete(pattern,1,1);
                     labelsym:=clabelsym.create(pattern);
                   end;

+ 1 - 1
compiler/pstatmnt.pas

@@ -1143,7 +1143,7 @@ implementation
 
                         { strip leading 0's in iso mode }
                         if (([m_iso,m_extpas]*current_settings.modeswitches)<>[]) then
-                          while pattern[1]='0' do
+                          while (length(pattern)>1) and (pattern[1]='0') do
                             delete(pattern,1,1);
 
                         searchsym(pattern,srsym,srsymtable);

+ 8 - 0
tests/webtbs/tw37428.pp

@@ -0,0 +1,8 @@
+{$mode iso}
+label
+  0;
+
+begin
+  0:
+    writeln('ok');
+end.