x/tools/go/ssa: wrong base pointer of loadconstraint when handling *ssa.Next in genInstr()@gen.go #45735
What version of Go are you using (
The text was updated successfully, but these errors were encountered:
cc @alandonovan is the original author of the package and probably understands this code the best. Fixing this requires understanding an edge case in the pointer package, in particular the constraint generation for (*ssa.Next) on maps. Below is a summary of what is happening. I am not yet confident I understand what needs to be fixed.
I was able to reproduce the report following https://grpc.io/docs/languages/go/quickstart/.
Here is what is happening in way too much detail.
The instruction is:
The local nodes are indeed as above (the constants differ from the original report):
At the end of the *ssa.Next case within genInstr() (line) the values of the following expressions are
From this we know the code took the else branch of
We then enter
This means we fall into the
This then creates the anomalous load constraint in the reported issue:
n169141 is just
All of that put together, it looks like (*ssa.Next) is trying to flatten the memory when the key is an invalid kind, but either:
Hopefully @alandonovan can give some direction on which of these (*ssa.Next) should be modeled as.