[llvm] [WebAssembly] Protect memory.fill and memory.copy from zero-length ranges. (PR #112617)

Dan Gohman via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 17 07:12:02 PDT 2024


================
@@ -21,16 +21,33 @@ multiclass BULK_I<dag oops_r, dag iops_r, dag oops_s, dag iops_s,
 }
 
 // Bespoke types and nodes for bulk memory ops
+
+// memory.copy (may trap on empty ranges)
+def wasm_memory_copy_t : SDTypeProfile<0, 5,
+  [SDTCisInt<0>, SDTCisInt<1>, SDTCisPtrTy<2>, SDTCisPtrTy<3>, SDTCisInt<4>]
+>;
----------------
sunfishcode wrote:

Done

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


More information about the llvm-commits mailing list