Dereferenced pointer to struct doesn't copy #30
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	
	No description provided.
		
		Delete branch "%!s()"
	 
	Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
I expect the struct to be copied when pointer is dereferenced similar to: https://godbolt.org/z/TE3GMaY77
Hi snorlax, thanks for the report!
I took a look at the
--ssa --func main.writedebug output from the compiler.The dereferencing doesn't show up in the output, instead it just copied the value like
p2 := p.I will check which part of the parser caused the incorrect compilation.
Just a heads up, this could take quite a bit of time to fix.
Edit:
Parsing bug fixed in
cli/q@6b3a26a80a.Temporary "not implemented" message added in
cli/q@87207b4191.Fixed in
cli/q@76cd1cf419.It will currently attempt to load every field from the struct into a local register.
This obviously needs some polishing, but at least the code you provided now prints the correct values.
Test:
cli/q@76cd1cf419/tests/struct-pointer-deref.qClosing this one because the provided code sample works now.
If you notice more code examples that don't have the desired output feel free to open new issues!