summaryrefslogtreecommitdiff
path: root/src/zisp/value.zig
diff options
context:
space:
mode:
authorTaylan Kammer <taylan.kammer@gmail.com>2026-06-22 19:05:48 +0200
committerTaylan Kammer <taylan.kammer@gmail.com>2026-06-22 19:05:48 +0200
commit8308e303a88779be0d0a6249d2d79ca56eb05ed0 (patch)
tree524e5fb474ce890fbf1e9b5311a7e7cdba33b0de /src/zisp/value.zig
parent476632d9559b1e3bacbd226df336116cac8544ea (diff)
Fix tests etc.
Diffstat (limited to 'src/zisp/value.zig')
-rw-r--r--src/zisp/value.zig6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/zisp/value.zig b/src/zisp/value.zig
index 2ae0524..fc815bd 100644
--- a/src/zisp/value.zig
+++ b/src/zisp/value.zig
@@ -272,13 +272,13 @@ pub const Value = packed union {
/// if this isn't a pointer at all. Could be useful for a dispatch table.
/// Note that unlike getPtr(), this can actually return a null pointer as
/// such, not conflating it with the "not a heap pointer" case.
- pub fn getPtrAny(v: Value) ?struct { ?Zptr, HeapType } {
+ pub fn getPtrAny(v: Value) ?struct { HeapType, ?Zptr } {
const hi16_bits: u16 = @intCast(v.bits >> 48);
if (hi16_bits != hi16_tag_ptr) return null;
- const ht: u4 = @truncate(hi16_bits);
+ const ht: u4 = @intCast(v.bits << 16 >> 60);
const pval: u48 = @intCast(v.bits << 20 >> 16);
- return .{ @ptrFromInt(pval), @enumFromInt(ht) };
+ return .{ @enumFromInt(ht), @ptrFromInt(pval) };
}
/// Checks if the value is a list pointer.