diff options
author | Alon Zakai <alonzakai@gmail.com> | 2015-11-27 19:05:48 -0800 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2015-11-27 19:05:48 -0800 |
commit | 60b6bf5509e56a96b9498eae9b8f629b8ccc58a8 (patch) | |
tree | cf60c7d13c6ba8bd6bfb6f5982db9367f78d9cb7 /src/wasm.h | |
parent | fafb8ad3b144bb84282004689fcd91f332f0ae78 (diff) | |
download | binaryen-60b6bf5509e56a96b9498eae9b8f629b8ccc58a8.tar.gz binaryen-60b6bf5509e56a96b9498eae9b8f629b8ccc58a8.tar.bz2 binaryen-60b6bf5509e56a96b9498eae9b8f629b8ccc58a8.zip |
handle no default when printing switch
Diffstat (limited to 'src/wasm.h')
-rw-r--r-- | src/wasm.h | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/wasm.h b/src/wasm.h index d272f2037..8fa9c6bda 100644 --- a/src/wasm.h +++ b/src/wasm.h @@ -449,11 +449,12 @@ public: incIndent(o, indent); printFullLine(o, indent, value); doIndent(o, indent) << "(table"; - assert(default_.is()); for (auto& t : targets) { o << " (case " << (t.is() ? t : default_) << ")"; } - o << ") (case " << default_ << ")\n"; + o << ")"; + if (default_.is()) o << " (case " << default_ << ")"; + o << "\n"; for (auto& c : cases) { doIndent(o, indent); printMinorOpening(o, "case ") << c.name; |