Browse Source

merge r17318 from cpstrnew branch by florian:
* compilation fix by Inoussa OUEDRAOGO, resolves #19160

git-svn-id: trunk@19104 -

paul 14 năm trước cách đây
mục cha
commit
9e0ad7baae
4 tập tin đã thay đổi với 14 bổ sung5 xóa
  1. 9 0
      compiler/pexpr.pas
  2. 2 2
      rtl/inc/astrings.inc
  3. 1 1
      rtl/inc/text.inc
  4. 2 2
      rtl/win/sysutils.pp

+ 9 - 0
compiler/pexpr.pas

@@ -108,6 +108,15 @@ implementation
                  { error recovery }
                  consume(_RECKKLAMMER);
                end
+             {else
+               begin
+                if (tordconstnode(p).value<=0) then
+                  begin
+                     Message(parser_e_invalid_string_size);
+                     tordconstnode(p).value:=255;
+                  end;
+                 consume(_RECKKLAMMER);
+               end}
              else
                begin
                 if (tordconstnode(p).value<=0) then

+ 2 - 2
rtl/inc/astrings.inc

@@ -595,7 +595,7 @@ end;
 {$else VER2_4}
 Procedure fpc_AnsiStr_CheckRange(p: Pointer; index: SizeInt);[Public,Alias : 'FPC_ANSISTR_RANGECHECK'];  compilerproc;
 begin
-  if (p=nil) or (index>PAnsiRec(p-FirstOff)^.Len) or (Index<1) then
+  if (p=nil) or (index>PAnsiRec(p-AnsiFirstOff)^.Len) or (Index<1) then
     HandleErrorFrame(201,get_frame);
 end;
 {$endif VER2_4}
@@ -1115,7 +1115,7 @@ end;
 Procedure SetString (Out S : AnsiString; Buf : PWideChar; Len : SizeInt);
 begin
   if (Buf<>nil) and (Len>0) then
-    widestringmanager.Wide2AnsiMoveProc(Buf,S,Len)
+    widestringmanager.Wide2AnsiMoveProc(Buf,S,DefaultSystemCodePage,Len)
   else
     SetLength(S, Len);
 end;

+ 1 - 1
rtl/inc/text.inc

@@ -1371,7 +1371,7 @@ Begin
         else
           begin
             { valid code point -> convert to widestring}
-            widestringmanager.Ansi2WideMoveProc(@str[0],ws,i+1);
+            widestringmanager.Ansi2WideMoveProc(@str[0],DefaultSystemCodePage,ws,i+1);
             { has to be exactly one widechar }
             if length(ws)=1 then
               begin

+ 2 - 2
rtl/win/sysutils.pp

@@ -1113,9 +1113,9 @@ function DoCompareStringA(P1, P2: PWideChar; L1, L2: PtrUInt; Flags: DWORD): Ptr
     a1, a2: AnsiString;
   begin
     if L1>0 then
-      widestringmanager.Wide2AnsiMoveProc(P1,a1,L1);
+      widestringmanager.Wide2AnsiMoveProc(P1,a1,DefaultSystemCodePage,L1);
     if L2>0 then
-      widestringmanager.Wide2AnsiMoveProc(P2,a2,L2);
+      widestringmanager.Wide2AnsiMoveProc(P2,a2,DefaultSystemCodePage,L2);
     SetLastError(0);
     Result:=CompareStringA(LOCALE_USER_DEFAULT,Flags,pchar(a1),
       length(a1),pchar(a2),length(a2))-2;