From 8308e303a88779be0d0a6249d2d79ca56eb05ed0 Mon Sep 17 00:00:00 2001 From: Taylan Kammer Date: Mon, 22 Jun 2026 19:05:48 +0200 Subject: Fix tests etc. --- src/zisp/value.zig | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/zisp/value.zig') 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. -- cgit v1.2.3