aboutsummaryrefslogtreecommitdiff
path: root/src/value.zig
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2021-11-16 17:46:39 -0700
committerAndrew Kelley <andrew@ziglang.org>2021-11-16 17:46:39 -0700
commit09588c795c08064971f61ee147d06972f0add94e (patch)
treed7d2af6503aea7aa499c1a5eabf3c2f5a3591d3a /src/value.zig
parent68fe391de02fd4c99f39bd6e0af643e1e327e52a (diff)
downloadzig-09588c795c08064971f61ee147d06972f0add94e.tar.gz
zig-09588c795c08064971f61ee147d06972f0add94e.zip
stage2: LLVM backend: memset to 0xaa for undefined stores
Also support `one` and `int_big_positive` tags for const pointers.
Diffstat (limited to 'src/value.zig')
-rw-r--r--src/value.zig7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/value.zig b/src/value.zig
index 4b571891f4..4eaa865149 100644
--- a/src/value.zig
+++ b/src/value.zig
@@ -1802,6 +1802,13 @@ pub const Value = extern union {
return self.tag() == .undef;
}
+ /// TODO: check for cases such as array that is not marked undef but all the element
+ /// values are marked undef, or struct that is not marked undef but all fields are marked
+ /// undef, etc.
+ pub fn isUndefDeep(self: Value) bool {
+ return self.isUndef();
+ }
+
/// Asserts the value is not undefined and not unreachable.
/// Integer value 0 is considered null because of C pointers.
pub fn isNull(self: Value) bool {