[llvm] [WebAssembly] Handle block and polymorphic stack in AsmTypeCheck (PR #110770)

Heejin Ahn via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 1 17:22:30 PDT 2024


================
@@ -498,7 +498,9 @@ class WebAssemblyAsmParser final : public MCTargetAsmParser {
 
   void addBlockTypeOperand(OperandVector &Operands, SMLoc NameLoc,
                            WebAssembly::BlockType BT) {
-    if (BT != WebAssembly::BlockType::Void) {
+    if (BT == WebAssembly::BlockType::Void) {
+      TC.setLastSig(wasm::WasmSignature{});
+    } else {
----------------
aheejin wrote:

Before, when we have a non-void block we set the signature in the type checker, but not when we have a void block. So if we have a non-void block and then a void block, the type checker incorrectly thought void block's signature was the same as the previous (non-void ) one.

https://github.com/llvm/llvm-project/pull/110770


More information about the llvm-commits mailing list