aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/jsruntime/qv4scopedvalue_p.h
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@theqtcompany.com>2014-12-15 08:47:35 +0100
committerSimon Hausmann <simon.hausmann@digia.com>2014-12-19 16:30:10 +0100
commit0de16adf3d48f56e7556df392c38bcfd2b8c9796 (patch)
tree47c81c8f8bb2d462e352a4a070795189edf9fdb4 /src/qml/jsruntime/qv4scopedvalue_p.h
parent45ff1411d068c69d35a76b41e0d7da9a9d394d27 (diff)
Mark JS freed parts of the JS stack as undefined in valgrind
Change-Id: Ibee3d95762bc0a0124b65ad8986ed643b9535529 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'src/qml/jsruntime/qv4scopedvalue_p.h')
-rw-r--r--src/qml/jsruntime/qv4scopedvalue_p.h11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/qml/jsruntime/qv4scopedvalue_p.h b/src/qml/jsruntime/qv4scopedvalue_p.h
index c33adca029..461d499694 100644
--- a/src/qml/jsruntime/qv4scopedvalue_p.h
+++ b/src/qml/jsruntime/qv4scopedvalue_p.h
@@ -38,6 +38,10 @@
#include "qv4persistent_p.h"
#include "qv4property_p.h"
+#ifdef V4_USE_VALGRIND
+#include <valgrind/memcheck.h>
+#endif
+
QT_BEGIN_NAMESPACE
#define SAVE_JS_STACK(ctx) Value *__jsStack = ctx->engine->jsStackTop
@@ -50,9 +54,9 @@ struct ScopedValue;
struct Scope {
inline Scope(ExecutionContext *ctx)
: engine(ctx->d()->engine)
- #ifndef QT_NO_DEBUG
+#ifndef QT_NO_DEBUG
, size(0)
- #endif
+#endif
{
mark = engine->jsStackTop;
}
@@ -71,6 +75,9 @@ struct Scope {
Q_ASSERT(engine->jsStackTop >= mark);
memset(mark, 0, (engine->jsStackTop - mark)*sizeof(Value));
#endif
+#ifdef V4_USE_VALGRIND
+ VALGRIND_MAKE_MEM_UNDEFINED(mark, engine->jsStackLimit - mark);
+#endif
engine->jsStackTop = mark;
}