Просмотр исходного кода

Merged revisions 7868 via svnmerge from
http://svn.freepascal.org/svn/fpc/trunk

........
r7868 | yury | 2007-06-30 15:28:03 +0300 (Сб, 30 июн 2007) | 1 line

* Fixed bug #9170.
........

git-svn-id: branches/fixes_2_2@7869 -

yury 18 лет назад
Родитель
Сommit
eaf78ac7be
1 измененных файлов с 8 добавлено и 0 удалено
  1. 8 0
      rtl/inc/wstrings.inc

+ 8 - 0
rtl/inc/wstrings.inc

@@ -221,6 +221,14 @@ Begin
   if declocked(l^) then
     { Ref count dropped to zero ...
       ... remove }
+{$else}
+  { Here we check if widestring is constant (located in .data section).
+    initialstklen variable is compiler generated and always located at the beginning of .data section.
+    ExitCode is zero initialized variable and located somewhere in .bss section which is followed
+    by .data section in memory.
+    If widestring points to the address space between initialstklen and ExitCode then it is constant
+    and there is no need to dispose it. }
+  if (S<@initialstklen) or (S>@ExitCode) then
 {$endif FPC_WINLIKEWIDESTRING}
     DisposeWideString(S);
 end;