aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/compiler/qv4instr_moth_p.h
diff options
context:
space:
mode:
authorErik Verbruggen <erik.verbruggen@qt.io>2017-09-13 14:19:13 +0200
committerErik Verbruggen <erik.verbruggen@qt.io>2017-09-13 13:00:05 +0000
commitfe609bb6a7924d716cda6f8f0a5572bc900df724 (patch)
tree7d16fc5bb5576dcbcff1384f4d39bb2bebe63268 /src/qml/compiler/qv4instr_moth_p.h
parent2bf1f4af53bd43ff91b33b3b847bf5ea502d4911 (diff)
Fix wide instruction dispatch
... by actually doing a dispatch. Change-Id: I80ccbda6f52fcc9da27977f7c0a5bc526926181b Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Diffstat (limited to 'src/qml/compiler/qv4instr_moth_p.h')
-rw-r--r--src/qml/compiler/qv4instr_moth_p.h9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/qml/compiler/qv4instr_moth_p.h b/src/qml/compiler/qv4instr_moth_p.h
index 39309aad2b..3f6e7b9db4 100644
--- a/src/qml/compiler/qv4instr_moth_p.h
+++ b/src/qml/compiler/qv4instr_moth_p.h
@@ -353,7 +353,6 @@ QT_BEGIN_NAMESPACE
#define MOTH_DECODE_INSTRUCTION(name, nargs, ...) \
MOTH_DEFINE_ARGS(nargs, __VA_ARGS__) \
- goto op_int_##name; \
op_int_##name: \
MOTH_ADJUST_CODE(int, nargs); \
MOTH_DECODE_ARGS(name, int, nargs, __VA_ARGS__) \
@@ -367,7 +366,6 @@ QT_BEGIN_NAMESPACE
#define MOTH_DECODE_WITH_BASE_INSTRUCTION(name, nargs, ...) \
MOTH_DEFINE_ARGS(nargs, __VA_ARGS__) \
const char *base_ptr; \
- goto op_int_##name; \
op_int_##name: \
base_ptr = code; \
MOTH_ADJUST_CODE(int, nargs); \
@@ -421,15 +419,16 @@ QT_BEGIN_NAMESPACE
#define MOTH_INSTR_CASE_AND_JUMP(instr) \
INSTR_##instr(GET_CASE_AND_JUMP)
#define GET_CASE_AND_JUMP_INSTRUCTION(name, ...) \
- case Instr::Type::name: goto op_char_##name;
+ case static_cast<uchar>(Instr::Type::name): goto op_char_##name;
#define MOTH_INSTR_CASE_AND_JUMP_WIDE(instr) \
INSTR_##instr(GET_CASE_AND_JUMP_WIDE)
#define GET_CASE_AND_JUMP_WIDE_INSTRUCTION(name, ...) \
- case Instr::Type::name: goto op_int_##name;
+ case (static_cast<uchar>(Instr::Type::name) + MOTH_NUM_INSTRUCTIONS()): goto op_int_##name;
#define MOTH_DISPATCH() \
- switch (static_cast<Instr::Type>(*code)) { \
+ switch (static_cast<uchar>(*code)) { \
FOR_EACH_MOTH_INSTR(MOTH_INSTR_CASE_AND_JUMP) \
+ FOR_EACH_MOTH_INSTR(MOTH_INSTR_CASE_AND_JUMP_WIDE) \
}
#endif