]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Add assertion + comment to a loop using VG_(getcwd).
authorJulian Seward <jseward@acm.org>
Mon, 26 Mar 2007 15:23:20 +0000 (15:23 +0000)
committerJulian Seward <jseward@acm.org>
Mon, 26 Mar 2007 15:23:20 +0000 (15:23 +0000)
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@6663

callgrind/dump.c

index 2904e96366b4635d4753da5db90dde63826d4634..7172533b5fceb2cd9588b8417ab8771c78943c9e 100644 (file)
@@ -1694,6 +1694,11 @@ void CLG_(init_dumps)()
                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;