summaryrefslogtreecommitdiff
path: root/src/binary-writer.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/binary-writer.cc')
-rw-r--r--src/binary-writer.cc7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/binary-writer.cc b/src/binary-writer.cc
index 5705fc1f..2a8e04da 100644
--- a/src/binary-writer.cc
+++ b/src/binary-writer.cc
@@ -142,7 +142,12 @@ void WriteStr(Stream* stream,
}
void WriteOpcode(Stream* stream, Opcode opcode) {
- stream->WriteU8Enum(opcode.GetCode(), opcode.GetName());
+ if (opcode.HasPrefix()) {
+ stream->WriteU8(opcode.GetPrefix(), "prefix");
+ WriteU32Leb128(stream, opcode.GetCode(), opcode.GetName());
+ } else {
+ stream->WriteU8(opcode.GetCode(), opcode.GetName());
+ }
}
void WriteType(Stream* stream, Type type) {