/ go Public
cmd/compile: unnecessary nil pointer check #40108
Issues related to the Go compiler and/or runtime.
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
This code generates a nil pointer check on
We don't really need a nil pointer check, as the index is bounded by the bounds check.
We can subsume the nil pointer check into the load.
This would require the nil pointer pass to know that indexes are bounded for indexed loads, so it can prove that the load still occurs in the zero page even with the largest possible index.
Maybe we need to keep some information from the prove pass around somehow?
The text was updated successfully, but these errors were encountered: