summaryrefslogtreecommitdiff
path: root/src/wasm.h
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2016-01-06 16:27:05 -0800
committerAlon Zakai <alonzakai@gmail.com>2016-01-06 16:27:05 -0800
commit3c32e7144c787fdba4953d98d9eb997abf407306 (patch)
tree25a6ae17bc4fc65832ceaab6ddac43df98231a76 /src/wasm.h
parent8ae085fb1f79d6a72d234c5d33704f6106fe6f4b (diff)
downloadbinaryen-3c32e7144c787fdba4953d98d9eb997abf407306.tar.gz
binaryen-3c32e7144c787fdba4953d98d9eb997abf407306.tar.bz2
binaryen-3c32e7144c787fdba4953d98d9eb997abf407306.zip
fix switch br/case printing #70
Diffstat (limited to 'src/wasm.h')
-rw-r--r--src/wasm.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/wasm.h b/src/wasm.h
index 5fd4ad53b..55cc75cf9 100644
--- a/src/wasm.h
+++ b/src/wasm.h
@@ -466,8 +466,12 @@ public:
incIndent(o, indent);
printFullLine(o, indent, value);
doIndent(o, indent) << "(table";
+ std::set<Name> caseNames;
+ for (auto& c : cases) {
+ caseNames.insert(c.name);
+ }
for (auto& t : targets) {
- o << " (case " << (t.is() ? t : default_) << ")";
+ o << " (" << (caseNames.count(t) == 0 ? "br" : "case") << " " << (t.is() ? t : default_) << ")";
}
o << ")";
if (default_.is()) o << " (case " << default_ << ")";