|
From: <sv...@va...> - 2007-03-26 15:23:24
|
Author: sewardj
Date: 2007-03-26 16:23:20 +0100 (Mon, 26 Mar 2007)
New Revision: 6663
Log:
Add assertion + comment to a loop using VG_(getcwd).
Modified:
trunk/callgrind/dump.c
Modified: trunk/callgrind/dump.c
===================================================================
--- trunk/callgrind/dump.c 2007-03-26 07:33:12 UTC (rev 6662)
+++ trunk/callgrind/dump.c 2007-03-26 15:23:20 UTC (rev 6663)
@@ -1694,6 +1694,11 @@
base_directory = 0;
size *= 2;
}
+ /* in fact, this loop could run forever (or at least till
+ CLG_MALLOC fails) if VG_(getcwd) returns False for any
+ reason other than the buffer is too small. So be
+ safe: */
+ tl_assert( size < 100 * 200 );
}
size = VG_(strlen)(base_directory) + VG_(strlen)(CLG_(clo).filename_base) +2;
|