Index: lib/Target/WebAssembly/InstPrinter/WebAssemblyInstPrinter.cpp =================================================================== --- lib/Target/WebAssembly/InstPrinter/WebAssemblyInstPrinter.cpp +++ lib/Target/WebAssembly/InstPrinter/WebAssemblyInstPrinter.cpp @@ -85,16 +85,14 @@ break; case WebAssembly::END_LOOP: case WebAssembly::END_LOOP_S: - // Have to guard against an empty stack, in case of mismatched pairs - // in assembly parsing. - if (!ControlFlowStack.empty()) - ControlFlowStack.pop_back(); + assert(!ControlFlowStack.empty() && "End marker mismatch!"); + ControlFlowStack.pop_back(); break; case WebAssembly::END_BLOCK: case WebAssembly::END_BLOCK_S: - if (!ControlFlowStack.empty()) - printAnnotation( - OS, "label" + utostr(ControlFlowStack.pop_back_val().first) + ':'); + assert(!ControlFlowStack.empty() && "End marker mismatch!"); + printAnnotation( + OS, "label" + utostr(ControlFlowStack.pop_back_val().first) + ':'); break; }