Bläddra i källkod

Reword the heaptrc message if the corruption is spot incrementally.

Rika Ichinose 1 dag sedan
förälder
incheckning
0666ce8bda
1 ändrade filer med 5 tillägg och 2 borttagningar
  1. 5 2
      rtl/inc/heaptrc.pp

+ 5 - 2
rtl/inc/heaptrc.pp

@@ -1987,7 +1987,10 @@ type
         writeln(outfp^, 'Allocated at:');
       DumpTrace(outfp^, n);
     end;
-    writeln(outfp^, 'Detected at:');
+    if ([CheckFlag.InCheckHeap, CheckFlag.InPublicCheckHeap] * cf = [CheckFlag.InCheckHeap]) or (CheckFlag.InFreeToFreeItems in cf) then
+      writeln(outfp^, 'Incidentally spotted by:')
+    else
+      writeln(outfp^, 'Detected by:');
     DumpStackAndMaybeThrowRunError(cf);
     dec(insideReport);
   end;
@@ -2746,7 +2749,7 @@ finalization
           'Exitcode = ', ExitCode)
       else
       begin
-        ht.CheckHeap(High(SizeUint), []);
+        CheckHeap; // Note ht.ReportCorrupted makes a slight difference between CheckHeap and ht.CheckHeap when forming a message.
         ht.Report(ht.outfp^, GlobalSkipIfNoLeaks);
       end;
     end;