[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


================
@@ -1002,7 +1004,8 @@ class WebAssemblyAsmParser final : public MCTargetAsmParser {
       auto *Signature = Ctx.createWasmSignature();
       if (parseSignature(Signature))
         return ParseStatus::Failure;
-      TC.funcDecl(*Signature);
+      if (CurrentState == FunctionStart)
+        TC.funcDecl(*Signature);
----------------
aheejin wrote:

`.functype` directive does not only happen at the start of a function but also just to declare a function type that does not have a definition associated with it. But we used to set the current function's signature whenever we parsed a `.functype`. This resulted (incorrectly) in calling `funcDecl` twice, and pushing to `BlockInfoStack` twice.

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


More information about the llvm-commits mailing list