[PATCH] D146781: [Webassembly] consider invalid CALL_S in removeRegisterOperands

Congcong Cai via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 28 06:56:23 PDT 2023


HerrCai0907 updated this revision to Diff 508995.
HerrCai0907 added a comment.

detail fix see https://reviews.llvm.org/D147033, only add assert in this patch to avoid further spread of errors


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D146781/new/

https://reviews.llvm.org/D146781

Files:
  llvm/lib/Target/WebAssembly/WebAssemblyMCInstLower.cpp


Index: llvm/lib/Target/WebAssembly/WebAssemblyMCInstLower.cpp
===================================================================
--- llvm/lib/Target/WebAssembly/WebAssemblyMCInstLower.cpp
+++ llvm/lib/Target/WebAssembly/WebAssemblyMCInstLower.cpp
@@ -300,4 +300,6 @@
       OutMI.erase(&MO);
     }
   }
+  // CALL_S should at least have 1 operand, otherwise this code is invalid.
+  assert(!(StackOpcode == WebAssembly::CALL_S && OutMI.getNumOperands() == 0));
 }


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D146781.508995.patch
Type: text/x-patch
Size: 466 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230328/31297a56/attachment.bin>


More information about the llvm-commits mailing list