diff options
| author | Alex Rønne Petersen <alex@alexrp.com> | 2024-07-25 22:06:29 +0200 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2024-07-25 18:04:50 -0700 |
| commit | 1c35e73b614398529782f8c027366c6d8d51ac4b (patch) | |
| tree | 250c777f79bd747416f105111592fc7c79a344d6 /lib/std/Build.zig | |
| parent | 81a172a5064559d1f968f240204f8ce545852441 (diff) | |
| download | zig-1c35e73b614398529782f8c027366c6d8d51ac4b.tar.gz zig-1c35e73b614398529782f8c027366c6d8d51ac4b.zip | |
llvm: Don't emit safety memset() for stores of undef in Debug with safety off.
Before, this code:
@setRuntimeSafety(false);
var arr: [38]elf.Addr = undefined;
would emit a call to memset() in the output code in Debug mode, while in all the
release modes, LLVM optimized the memset() out as expected. Emitting the call in
Debug mode is problematic in some contexts, e.g. in std.os.linux.start_pie where
we are not yet ready to correctly perform calls because relocations haven't been
applied yet, or in the early stages of a dynamic linker, etc.
Diffstat (limited to 'lib/std/Build.zig')
0 files changed, 0 insertions, 0 deletions
