浏览代码

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

git-svn-id: trunk@14906 -
Jonas Maebe 15 年之前
父节点
当前提交
a37850742c
共有 1 个文件被更改,包括 4 次插入1 次删除
  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;