fix: make seen map mutable and use u64 for tagged-value shifts

The struct-literal validator declared `seen` without `mut`, causing a
compile error on V.  Left-shifting i64 values also produced signed-shift
warnings; cast through u64 instead.

🤖 Generated with Codebuff
Co-Authored-By: Codebuff <noreply@codebuff.com>
This commit is contained in:
allexanderbergmns
2026-08-24 17:37:27 +02:00
parent 68dc251ecc
commit 9504a9301b
2 changed files with 5 additions and 5 deletions
+4 -4
View File
@@ -514,7 +514,7 @@ fn (mut v Vm) is_struct(x i64) bool {
}
fn (mut v Vm) enc_int(x i64) i64 {
return x << 2
return u64(x) << 2
}
fn (mut v Vm) dec_int(x i64) i64 {
@@ -526,15 +526,15 @@ fn (mut v Vm) hand(x i64) int {
}
fn (mut v Vm) mkstr(idx int) i64 {
return (i64(idx) << 2) | 1
return (u64(idx) << 2) | 1
}
fn (mut v Vm) mkarr(idx int) i64 {
return (i64(idx) << 2) | 3
return (u64(idx) << 2) | 3
}
fn (mut v Vm) mkstruct_handle(idx int) i64 {
return (i64(idx) << 2) | 2
return (u64(idx) << 2) | 2
}
fn (mut v Vm) truthy(x i64) bool {