You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
V full version: V 0.4.8 5ec9bb5.fbc3fc6
OS: linux, Linux version 6.6.8-arch1-1 (linux@archlinux) (gcc (GCC) 13.2.1 20230801, GNU ld (GNU Binutils) 2.41.0) #1 SMP PREEMPT_DYNAMIC Thu, 21 Dec 2023 19:01:01 +0000
Processor: 16 cpus, 64bit, little endian, 12th Gen Intel(R) Core(TM) i5-1240P
getwd: /home/ge/Code/v/netaddr/fixed_array_issues
vexe: /home/ge/.vlang/v
vexe mtime: 2024-11-20 20:10:01
vroot: OK, value: /home/ge/.vlang
VMODULES: OK, value: /home/ge/.vmodules
VTMP: OK, value: /tmp/v_1000
Git version: git version 2.46.1
Git vroot status: weekly.2024.47-2-gfbc3fc6f
.git/config present: true
CC version: cc (GCC) 14.2.1 20240910
emcc version: N/A
thirdparty/tcc status: thirdparty-linux-amd64 0134e9b9
What did you do? ./v -g -o vdbg cmd/v && ./vdbg fixed_array_alias_append_to_array.v
modulemainpubtypeAddr= [4]u8fnmain() {
mutmy_array:= []Addr{}
fori:=0; i <=3; i++ {
// After adding an element to the my_array array, we lose the value// of the right expression and as a result we get an array filled// with random data that changes every time the program is run.
my_array <<dump(Addr([u8(10), 0, 0, u8(i)]!))
}
assert my_array[0] ==Addr([u8(10), 0, 0, 0]!)
assert my_array[1] ==Addr([u8(10), 0, 0, 1]!)
assert my_array[2] ==Addr([u8(10), 0, 0, 2]!)
assert my_array[3] ==Addr([u8(10), 0, 0, 3]!)
}
What did you expect to see?
Assertion passed.
What did you see instead?
[fixed_array_alias_append_to_array.v:17] Addr([u8(10), 0, 0, u8(i)]u8{}): Addr([10, 0, 0, 0])
[fixed_array_alias_append_to_array.v:17] Addr([u8(10), 0, 0, u8(i)]u8{}): Addr([10, 0, 0, 1])
[fixed_array_alias_append_to_array.v:17] Addr([u8(10), 0, 0, u8(i)]u8{}): Addr([10, 0, 0, 2])
[fixed_array_alias_append_to_array.v:17] Addr([u8(10), 0, 0, u8(i)]u8{}): Addr([10, 0, 0, 3])
fixed_array_alias_append_to_array.v:19: FAIL: fn main.main: assert my_array[0] == Addr([u8(10), 0, 0, 0]u8{})
left value: my_array[0] = Addr([236, 0, 0, 0])
right value: Addr([u8(10), 0, 0, 0]u8{})
V panic: Assertion failed...
v hash: fbc3fc6
/tmp/v_1000/fixed_array_alias_append_to_array.01JD5RC8QEHDGMD8T9ZF12HEQE.tmp.c:7476: at _v_panic: Backtrace
/tmp/v_1000/fixed_array_alias_append_to_array.01JD5RC8QEHDGMD8T9ZF12HEQE.tmp.c:14407: by main__main
/tmp/v_1000/fixed_array_alias_append_to_array.01JD5RC8QEHDGMD8T9ZF12HEQE.tmp.c:14499: by main
Note
You can use the 👍 reaction to increase the issue's priority for developers.
Please note that only the 👍 reaction to the issue itself counts as a vote.
Other reactions and those to comments will not be taken into account.
V doctor:
What did you do?
./v -g -o vdbg cmd/v && ./vdbg fixed_array_alias_append_to_array.v
What did you expect to see?
Assertion passed.
What did you see instead?
Note
You can use the 👍 reaction to increase the issue's priority for developers.
Please note that only the 👍 reaction to the issue itself counts as a vote.
Other reactions and those to comments will not be taken into account.
Huly®: V_0.6-21368
The text was updated successfully, but these errors were encountered: