]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Don't produce suppression stack pseudo-traces with more than
authorJulian Seward <jseward@acm.org>
Fri, 28 Jan 2011 00:44:52 +0000 (00:44 +0000)
committerJulian Seward <jseward@acm.org>
Fri, 28 Jan 2011 00:44:52 +0000 (00:44 +0000)
VG_MAX_SUPP_CALLERS entries in them.  Fixes #255822.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11515

coregrind/m_errormgr.c

index 96638e55e30e0e319c45b33aa6e2c5997a420f09..d04374766751e4f1919497b61f3b366a4895c96a 100644 (file)
@@ -376,10 +376,14 @@ static void gen_suppression(Error* err)
       VG_(xaprintf)(text, "   %s\n", xtra);
 
    // Print stack trace elements
+   UInt n_ips = VG_(get_ExeContext_n_ips)(ec);
+   tl_assert(n_ips > 0);
+   if (n_ips > VG_MAX_SUPP_CALLERS)
+      n_ips = VG_MAX_SUPP_CALLERS;
    VG_(apply_StackTrace)(printSuppForIp_nonXML,
                          text,
                          VG_(get_ExeContext_StackTrace)(ec),
-                         VG_(get_ExeContext_n_ips)(ec));
+                         n_ips);
 
    VG_(xaprintf)(text, "}\n");
    // zero terminate