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
Incorrect handling of pointers within maps, when attempting to access a map that contains nested maps, where the innermost map's values are pointers to net.TcpConn objects.
Reproduction Steps
Create a map with a string key and a value that is another map, where the inner map's values are reference to net.TcpConn objects (eg) con_list map[string]map[string]&net.TcpConn.
Attempt to access an element in the inner map.
Observe that the returned value is a pointer to the reference net.TcpConn object, not a reference.
Describe the bug
Incorrect handling of pointers within maps, when attempting to access a map that contains nested maps, where the innermost map's values are pointers to net.TcpConn objects.
Reproduction Steps
Create a map with a string key and a value that is another map, where the inner map's values are reference to net.TcpConn objects (eg) con_list map[string]map[string]&net.TcpConn.
Attempt to access an element in the inner map.
Observe that the returned value is a pointer to the reference net.TcpConn object, not a reference.
Full source code: transport/transport.v https://0x0.st/Xr_o.v
main.v https://0x0.st/XrzL.v
Expected Behavior
Accessing an element in the inner map should return a reference to the net.TcpConn object (&net.TcpConn).
Current Behavior
A pointer to the net.TcpConn object is returned instead of a reference. (&&net.TcpConn)
Possible Solution
A possible workaround would be to create a mutable copy of reference.
Additional Information/Context
No response
V version
V 0.4.4 44c78ed
Environment details (OS name and version, etc.)
V full version: V 0.4.4 298a2a2.44c78ed
OS: linux, "Arch Linux"
Processor: 8 cpus, 64bit, little endian, Intel(R) Core(TM) i5 CPU 1155G7 @ 2.50GHz
getwd: /home/alienx/Projects/Git_Pro/V_Projects/testing/testing/multi_conx/src
vexe: /home/alienx/Public/v/v
vexe mtime: 2024-03-20 01:46:39
vroot: OK, value: /home/alienx/Public/v
VMODULES: OK, value: /home/alienx/.vmodules
VTMP: OK, value: /tmp/v_1000
Git version: git version 2.44.0
Git vroot status: weekly.2024.12-5-g44c78ed7
.git/config present: true
CC version: cc (GCC) 13.2.1 20230801
thirdparty/tcc status: thirdparty-linux-amd64 40e5cbb5
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.
The text was updated successfully, but these errors were encountered: