summaryrefslogtreecommitdiff
path: root/src/zisp/value.zig
diff options
context:
space:
mode:
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.