|
From: Florian K. <br...@ac...> - 2012-06-28 10:19:54
|
A week or so ago somebody wanted to run with --num-callers=100 which did
not fly because there is a hard-wired maximum of 50. This is kind of
lame in particular in this instance where it can easily be avoided by
using a variable length array:
Index: coregrind/m_execontext.c
===================================================================
--- coregrind/m_execontext.c (revision 12623)
+++ coregrind/m_execontext.c (working copy)
@@ -297,7 +297,7 @@
static ExeContext* record_ExeContext_wrk ( ThreadId tid, Word
first_ip_delta,
Bool first_ip_only )
{
- Addr ips[VG_DEEPEST_BACKTRACE];
+ Addr ips[VG_(clo_backtrace_size)];
UInt n_ips;
init_ExeContext_storage();
VLAs are part of C for more than a decade now so I presume their use
should be OK (we're requiring C99 features in other places already, e.g.
mixing declarations and statements). Both gcc and clang support them.
I have a proper patch to fix the above issue but wanted to double check
first that use of VLAs is OK in valgrind.
Florian
|