diff options
author | Dan Gohman <dev@sunfishcode.online> | 2024-10-24 14:13:58 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-10-24 14:13:58 -0700 |
commit | 118445841d4d50b57ea2892a18f0b656526f804d (patch) | |
tree | d24cf1cab07bbf53e039c7a6756d55278de361bf /flang/lib/Frontend/CompilerInvocation.cpp | |
parent | 4c8779388fd2f25730a1b044f9f10d6717833fce (diff) | |
download | llvm-118445841d4d50b57ea2892a18f0b656526f804d.zip llvm-118445841d4d50b57ea2892a18f0b656526f804d.tar.gz llvm-118445841d4d50b57ea2892a18f0b656526f804d.tar.bz2 |
[WebAssembly] Protect memory.fill and memory.copy from zero-length ranges. (#112617)
WebAssembly's `memory.fill` and `memory.copy` instructions trap if the
pointers are out of bounds, even if the length is zero. This is
different from LLVM, which expects that it can call `memcpy` on
arbitrary invalid pointers if the length is zero. To avoid spurious
traps, branch around `memory.fill` and `memory.copy` when the length is
zero.
---------
Co-authored-by: Heejin Ahn <aheejin@gmail.com>
Diffstat (limited to 'flang/lib/Frontend/CompilerInvocation.cpp')
0 files changed, 0 insertions, 0 deletions