cmd/compile: unnecessary bounds check when indexing relative to the end #51622
Labels
compiler/runtime
Issues related to the Go compiler and/or runtime.
FrozenDueToAge
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Performance
Milestone
Using go1.17.5
Consider the following:
Part of the assembly includes:
This should be unnecessary since the previous
len(b) >= 3
check ensures that the buffer must contain thelen(b)-3
element. Thus, there is no possibility of the index panicking.\cc @martisch @randall77
The text was updated successfully, but these errors were encountered: