summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJanne Koskinen <janne.p.koskinen@qt.io>2018-11-16 14:43:48 +0100
committerLars Knoll <lars.knoll@qt.io>2018-11-18 21:30:42 +0000
commitec290770ff56791a62fde6f532e1b38e80f5b9bd (patch)
tree23eee4587764b5d68944e2cdfc50e34db7c8556f
parent78745e5e778665f3a015e9cae109e77974d7fbe4 (diff)
Initialize Qt_AllocaWrapper allocation with zeroes
YarrJIT generated ASM assumes the data to be zeroed. In the wrapper we allocate from heap where there can be random data. It needs to be initialized to zero. Task-number: QTBUG-71663 Change-Id: I67c04e7b6d4bf4b92124aedc4f7bcfdc1a43c833 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
-rw-r--r--src/qml/jsruntime/qv4alloca_p.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/qml/jsruntime/qv4alloca_p.h b/src/qml/jsruntime/qv4alloca_p.h
index 1e9f83a90e..65c3e4d65a 100644
--- a/src/qml/jsruntime/qv4alloca_p.h
+++ b/src/qml/jsruntime/qv4alloca_p.h
@@ -89,7 +89,7 @@ public:
Qt_AllocaWrapper() { m_data = 0; }
~Qt_AllocaWrapper() { free(m_data); }
void *data() { return m_data; }
- void allocate(int size) { m_data = malloc(size); }
+ void allocate(int size) { m_data = malloc(size); memset(m_data, 0, size); }
private:
void *m_data;
};