diff options
author | Erik Verbruggen <erik.verbruggen@qt.io> | 2017-08-29 11:17:02 +0200 |
---|---|---|
committer | Lars Knoll <lars.knoll@qt.io> | 2017-08-29 09:28:03 +0000 |
commit | 99d5cdad6c8580d5ef31c291b721bf6230e2502f (patch) | |
tree | 2642382e8bad8556c66eeb4e1ccf7d9711d771f4 | |
parent | c5398fdb30bf07d06c533b980c7d7a08b3a9740d (diff) |
Fix compilation failures on Ubuntu 16.10 (gcc 6.2.0)
Change-Id: Ia70727deb008021cbef6e546816b33ff0ce64afa
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
-rw-r--r-- | src/qml/compiler/qv4codegen.cpp | 6 | ||||
-rw-r--r-- | src/qml/compiler/qv4instr_moth.cpp | 9 | ||||
-rw-r--r-- | src/qml/compiler/qv4instr_moth_p.h | 4 |
3 files changed, 11 insertions, 8 deletions
diff --git a/src/qml/compiler/qv4codegen.cpp b/src/qml/compiler/qv4codegen.cpp index d83764754c..7643212ea1 100644 --- a/src/qml/compiler/qv4codegen.cpp +++ b/src/qml/compiler/qv4codegen.cpp @@ -1461,8 +1461,7 @@ void Codegen::loadClosure(int closureId) load.value = closureId; bytecodeGenerator->addInstruction(load); } else { - Instruction::LoadUndefined load; - bytecodeGenerator->addInstruction(load); + Reference::fromConst(this, Encode::undefined()).loadInAccumulator(); } } @@ -3092,6 +3091,8 @@ void Codegen::Reference::loadInAccumulator() const case Accumulator: return; case Const: { +QT_WARNING_PUSH +QT_WARNING_DISABLE_GCC("-Wmaybe-uninitialized") // the loads below are empty structs. if (constant == Encode::null()) { Instruction::LoadNull load; codegen->bytecodeGenerator->addInstruction(load); @@ -3104,6 +3105,7 @@ void Codegen::Reference::loadInAccumulator() const } else if (constant == Encode::undefined()) { Instruction::LoadUndefined load; codegen->bytecodeGenerator->addInstruction(load); +QT_WARNING_POP } else { Value p = Primitive::fromReturnedValue(constant); if (p.isNumber()) { diff --git a/src/qml/compiler/qv4instr_moth.cpp b/src/qml/compiler/qv4instr_moth.cpp index ba1e2f5a23..056e8d6624 100644 --- a/src/qml/compiler/qv4instr_moth.cpp +++ b/src/qml/compiler/qv4instr_moth.cpp @@ -49,6 +49,7 @@ int Instr::size(Type type) FOR_EACH_MOTH_INSTR(MOTH_RETURN_INSTR_SIZE) } #undef MOTH_RETURN_INSTR_SIZE + Q_UNREACHABLE(); } static QByteArray alignedNumber(int n) { @@ -263,7 +264,7 @@ void dumpBytecode(const char *code, int len, int nLocals, int nFormals, int star MOTH_END_INSTR(StoreProperty) MOTH_BEGIN_INSTR(SetLookup) - d << StackSlot::dump(base, nFormals); + d << StackSlot::dump(base, nFormals) << "(" << index << ")"; MOTH_END_INSTR(SetLookup) MOTH_BEGIN_INSTR(StoreScopeObjectProperty) @@ -271,7 +272,7 @@ void dumpBytecode(const char *code, int len, int nLocals, int nFormals, int star MOTH_END_INSTR(StoreScopeObjectProperty) MOTH_BEGIN_INSTR(LoadScopeObjectProperty) - d << StackSlot::dump(base, nFormals) << "[" << propertyIndex << "]"; + d << StackSlot::dump(base, nFormals) << "[" << propertyIndex << "]" << (captureRequired ? " (capture)" : " (no capture)"); MOTH_END_INSTR(LoadScopeObjectProperty) MOTH_BEGIN_INSTR(StoreContextObjectProperty) @@ -279,7 +280,7 @@ void dumpBytecode(const char *code, int len, int nLocals, int nFormals, int star MOTH_END_INSTR(StoreContextObjectProperty) MOTH_BEGIN_INSTR(LoadContextObjectProperty) - d << StackSlot::dump(base, nFormals) << "[" << propertyIndex << "]"; + d << StackSlot::dump(base, nFormals) << "[" << propertyIndex << "]" << (captureRequired ? " (capture)" : " (no capture)"); MOTH_END_INSTR(LoadContextObjectProperty) MOTH_BEGIN_INSTR(LoadIdObject) @@ -295,7 +296,7 @@ void dumpBytecode(const char *code, int len, int nLocals, int nFormals, int star MOTH_END_INSTR(CallProperty) MOTH_BEGIN_INSTR(CallPropertyLookup) - d << lookupIndex << "(" << StackSlot::dump(callData, nFormals) << ")"; + d << StackSlot::dump(base, nFormals) << "." << lookupIndex << "(" << StackSlot::dump(callData, nFormals) << ")"; MOTH_END_INSTR(CallPropertyLookup) MOTH_BEGIN_INSTR(CallElement) diff --git a/src/qml/compiler/qv4instr_moth_p.h b/src/qml/compiler/qv4instr_moth_p.h index b8d62fac08..dc262f5a37 100644 --- a/src/qml/compiler/qv4instr_moth_p.h +++ b/src/qml/compiler/qv4instr_moth_p.h @@ -496,7 +496,7 @@ struct InstrMeta { QT_WARNING_PUSH QT_WARNING_DISABLE_GCC("-Wuninitialized") #define MOTH_INSTR_META_TEMPLATE(I) \ - template<> struct InstrMeta<(int)Instr::Type::I> { \ + template<> struct InstrMeta<int(Instr::Type::I)> { \ enum { Size = MOTH_INSTR_SIZE(I) }; \ typedef Instr::instr_##I DataType; \ static const DataType &data(const Instr &instr) { return instr.I; } \ @@ -515,7 +515,7 @@ class InstrData : public InstrMeta<InstrType>::DataType }; struct Instruction { -#define MOTH_INSTR_DATA_TYPEDEF(I) typedef InstrData<(int)Instr::Type::I> I; +#define MOTH_INSTR_DATA_TYPEDEF(I) typedef InstrData<int(Instr::Type::I)> I; FOR_EACH_MOTH_INSTR(MOTH_INSTR_DATA_TYPEDEF) #undef MOTH_INSTR_DATA_TYPEDEF private: |