aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/jsruntime/qv4scopedvalue_p.h
diff options
context:
space:
mode:
authorErik Verbruggen <erik.verbruggen@theqtcompany.com>2016-05-26 17:22:34 +0200
committerErik Verbruggen <erik.verbruggen@qt.io>2016-05-27 10:04:59 +0000
commitdbf7efde1e04ac0ff445f64438078d87eb035b68 (patch)
tree5b856f1ecccf22ac71ec18c9f2b196f1eec7290d /src/qml/jsruntime/qv4scopedvalue_p.h
parentcba2ef0a37f1e6972f1eb641c7157f9c69861c13 (diff)
V4: Mirror jsAlloc behavior at stack allocation.
Allocating from the JS stack will zero out the memory, and thus indicate to valgrind that memory is not uninitialized. By first marking the whole stack as uninitialized and only then allocating 2 entries, the behavior for those two entries will now match the allocation behavior. This fixes a false positive when using valgrind. Change-Id: Icdb5279e1cfbfe6b5c385cc42c556edf721fa74b Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'src/qml/jsruntime/qv4scopedvalue_p.h')
-rw-r--r--src/qml/jsruntime/qv4scopedvalue_p.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/qml/jsruntime/qv4scopedvalue_p.h b/src/qml/jsruntime/qv4scopedvalue_p.h
index d7fd44e1d6..ca7efb1e79 100644
--- a/src/qml/jsruntime/qv4scopedvalue_p.h
+++ b/src/qml/jsruntime/qv4scopedvalue_p.h
@@ -82,7 +82,7 @@ struct Scope {
memset(mark, 0, (engine->jsStackTop - mark)*sizeof(Value));
#endif
#ifdef V4_USE_VALGRIND
- VALGRIND_MAKE_MEM_UNDEFINED(mark, engine->jsStackLimit - mark);
+ VALGRIND_MAKE_MEM_UNDEFINED(mark, (engine->jsStackLimit - mark) * sizeof(Value));
#endif
engine->jsStackTop = mark;
}