diff options
author | Lars Knoll <lars.knoll@qt.io> | 2017-02-03 20:58:22 +0100 |
---|---|---|
committer | Lars Knoll <lars.knoll@qt.io> | 2017-03-09 08:58:49 +0000 |
commit | d7aa952e143accc18d54707d956d019272197078 (patch) | |
tree | 12e18ebb41cdd3ca1bc010e5bb1d6484fc96a9f5 /src/qml/jsruntime/qv4engine.cpp | |
parent | df3256b1f1eaa3ff9137ad1da36508365d978a8a (diff) |
Make writes to ArrayData write-barrier safe
Change-Id: I2e46100fe72fd83b36b3195130eefce5289d1627
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'src/qml/jsruntime/qv4engine.cpp')
-rw-r--r-- | src/qml/jsruntime/qv4engine.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/qml/jsruntime/qv4engine.cpp b/src/qml/jsruntime/qv4engine.cpp index f38580e5f8..02cd19008a 100644 --- a/src/qml/jsruntime/qv4engine.cpp +++ b/src/qml/jsruntime/qv4engine.cpp @@ -604,7 +604,9 @@ Heap::ArrayObject *ExecutionEngine::newArrayObject(const Value *values, int leng d->offset = 0; d->values.alloc = length; d->values.size = length; - memcpy(&d->values.v, values, length*sizeof(Value)); + // this doesn't require a write barrier, things will be ok, when the new array data gets inserted into + // the parent object + memcpy(&d->values.values, values, length*sizeof(Value)); a->d()->arrayData.set(this, d); a->setArrayLengthUnchecked(length); } |