C backend: avoid memcpy when len=0

As of Clang 18, calling memcpy() with a misaligned pointer trips UBSAN,
even if the length is zero. This unfortunately includes any call to
`@memcpy` when source or destination are undefined and the length is
zero.

This patch makes the C backend avoid calling memcpy when the length is
zero, thereby avoiding undefined behavior.

A zig1.wasm update will be needed in the llvm18 branch to activate this
code.
1c9bb6a79dAndrew Kelley committed on 4/30/2024, 5:00:53 PMparent956f53b
1 file changedLine totals unavailable