aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/compiler
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@intel.com>2014-02-14 14:31:23 -0800
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-02-16 05:10:57 +0100
commit64477bb2138fb2096f225e281ec7858a90cd55ab (patch)
treebc879e6e7b8695708fa9415cc97fc5015b76a879 /src/qml/compiler
parent72420889aa54342da4472683e67e2c70b76a170f (diff)
Reapply 612785f39e325b0578be89e09b0e32d7d08d471e fixing GCC warnings
See 612785f39e325b0578be89e09b0e32d7d08d471e for details. The warning is exactly the same as before, with the exact same solution as before. Change-Id: I2f6cbc64234696f1d240611f376ab5daf8d0f89c Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'src/qml/compiler')
-rw-r--r--src/qml/compiler/qv4instr_moth_p.h4
-rw-r--r--src/qml/compiler/qv4isel_moth_p.h2
2 files changed, 5 insertions, 1 deletions
diff --git a/src/qml/compiler/qv4instr_moth_p.h b/src/qml/compiler/qv4instr_moth_p.h
index e3e227796e..89fcafe921 100644
--- a/src/qml/compiler/qv4instr_moth_p.h
+++ b/src/qml/compiler/qv4instr_moth_p.h
@@ -825,6 +825,10 @@ struct InstrMeta {
typedef Instr::instr_##FMT DataType; \
static const DataType &data(const Instr &instr) { return instr.FMT; } \
static void setData(Instr &instr, const DataType &v) { instr.FMT = v; } \
+ static void setDataNoCommon(Instr &instr, const DataType &v) \
+ { memcpy(reinterpret_cast<char *>(&instr.FMT) + sizeof(Instr::instr_common), \
+ reinterpret_cast<const char *>(&v) + sizeof(Instr::instr_common), \
+ Size - sizeof(Instr::instr_common)); } \
};
FOR_EACH_MOTH_INSTR(MOTH_INSTR_META_TEMPLATE);
#undef MOTH_INSTR_META_TEMPLATE
diff --git a/src/qml/compiler/qv4isel_moth_p.h b/src/qml/compiler/qv4isel_moth_p.h
index b43868d186..41f839600f 100644
--- a/src/qml/compiler/qv4isel_moth_p.h
+++ b/src/qml/compiler/qv4isel_moth_p.h
@@ -202,7 +202,7 @@ template<int InstrT>
ptrdiff_t InstructionSelection::addInstruction(const InstrData<InstrT> &data)
{
Instr genericInstr;
- InstrMeta<InstrT>::setData(genericInstr, data);
+ InstrMeta<InstrT>::setDataNoCommon(genericInstr, data);
return addInstructionHelper(static_cast<Instr::Type>(InstrT), genericInstr);
}