aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/jsruntime/qv4value_p.h
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@qt.io>2017-02-17 11:18:35 +0100
committerLars Knoll <lars.knoll@qt.io>2017-03-09 08:58:40 +0000
commit38c9bc6b9f5f019f55896369c3b46c77fc29fb41 (patch)
treeb5a6ec37f5f2a551c185904683014726d50c6dcf /src/qml/jsruntime/qv4value_p.h
parent9242e5a685695356b2c9101a5e1642a726a6fede (diff)
Change getValueOrSetter to be write barrier friendly
Don't return a naked pointer into the heap, as this makes it impossible to track where and when we're writing into it. Change-Id: I2b9b81779ef8e9fb7a643ddda82aa6af8af459a7 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'src/qml/jsruntime/qv4value_p.h')
-rw-r--r--src/qml/jsruntime/qv4value_p.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/qml/jsruntime/qv4value_p.h b/src/qml/jsruntime/qv4value_p.h
index ce7dd8fb0d..93b0dfb6d4 100644
--- a/src/qml/jsruntime/qv4value_p.h
+++ b/src/qml/jsruntime/qv4value_p.h
@@ -722,6 +722,11 @@ struct ValueArray {
uint alloc;
Value v[1];
+ void set(ExecutionEngine *e, uint index, Value newVal) {
+ Q_UNUSED(e);
+ v[index] = newVal;
+ }
+
inline Value &operator[] (uint index) {
Q_ASSERT(index < alloc);
return v[index];