Procházet zdrojové kódy

* fixed range check error if cstringpattern is empty (r14789, r14850)

git-svn-id: trunk@14906 -
Jonas Maebe před 15 roky
rodič
revize
a37850742c
1 změnil soubory, kde provedl 4 přidání a 1 odebrání
  1. 4 1
      compiler/scanner.pas

+ 4 - 1
compiler/scanner.pas

@@ -3899,7 +3899,10 @@ In case not, the value returned can be arbitrary.
                                { convert existing string to an utf-8 string }
                                if not iswidestring then
                                  begin
-                                   ascii2unicode(@cstringpattern[1],len,patternw);
+                                   if len>0 then
+                                     ascii2unicode(@cstringpattern[1],len,patternw)
+                                   else
+                                     ascii2unicode(nil,len,patternw);
                                    iswidestring:=true;
                                    len:=0;
                                  end;