diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2023-05-02 20:01:32 -0700 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2023-06-10 20:40:03 -0700 |
| commit | 50f33734c6cec10a0132644c08ee443c2dd224e2 (patch) | |
| tree | d5192de4e7f849226b93cf03095a5ac7e54c3782 /src/value.zig | |
| parent | 00f82f1c46126f1fc6655c6142ef16e8e5afbf4e (diff) | |
| download | zig-50f33734c6cec10a0132644c08ee443c2dd224e2.tar.gz zig-50f33734c6cec10a0132644c08ee443c2dd224e2.zip | |
stage2: isGenericPoison InternPool awareness
Diffstat (limited to 'src/value.zig')
| -rw-r--r-- | src/value.zig | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/value.zig b/src/value.zig index 8c824b0720..d89be35d85 100644 --- a/src/value.zig +++ b/src/value.zig @@ -5416,6 +5416,14 @@ pub const Value = struct { return initPayload(&value_buffer.base); } + pub fn isGenericPoison(val: Value) bool { + return switch (val.ip_index) { + .generic_poison => true, + .none => val.tag() == .generic_poison, + else => false, + }; + } + /// This type is not copyable since it may contain pointers to its inner data. pub const Payload = struct { tag: Tag, |
