aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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);
}