summaryrefslogtreecommitdiff
path: root/src/binary-writer.cc
diff options
context:
space:
mode:
authorSam Clegg <sbc@chromium.org>2021-12-13 11:07:44 -0800
committerGitHub <noreply@github.com>2021-12-13 11:07:44 -0800
commit8538a888d4298f98b4a4f17d0e3a9496863cee2b (patch)
tree3a7ea607aca45c4f1a01266827c656c2989aa195 /src/binary-writer.cc
parent134bafd382348c5bb2e6e5494b84300d0160c2f1 (diff)
downloadwabt-8538a888d4298f98b4a4f17d0e3a9496863cee2b.tar.gz
wabt-8538a888d4298f98b4a4f17d0e3a9496863cee2b.tar.bz2
wabt-8538a888d4298f98b4a4f17d0e3a9496863cee2b.zip
Fix type names for function references (#1787)
This requires `Type::GetName` to return to be dynamicllay created and return `std::string` rather then a `const char*` As this diff shows this type name is only used in textual output and error messages so should this change should not have a effect of binary parse time or the interpreter.
Diffstat (limited to 'src/binary-writer.cc')
-rw-r--r--src/binary-writer.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/binary-writer.cc b/src/binary-writer.cc
index af60f73d..d7b0154c 100644
--- a/src/binary-writer.cc
+++ b/src/binary-writer.cc
@@ -56,10 +56,10 @@ void WriteOpcode(Stream* stream, Opcode opcode) {
}
void WriteType(Stream* stream, Type type, const char* desc) {
- WriteS32Leb128(stream, type, desc ? desc : type.GetName());
+ WriteS32Leb128(stream, type, desc ? desc : type.GetName().c_str());
if (type.IsReferenceWithIndex()) {
WriteS32Leb128(stream, type.GetReferenceIndex(),
- desc ? desc : type.GetName());
+ desc ? desc : type.GetName().c_str());
}
}