• Keith Randall's avatar
    cmd/compile: don't write back unchanged slice results · d4663e13
    Keith Randall authored
    Don't write back parts of a slicing operation if they
    are unchanged from the source of the slice.  For example:
    
    x.s = x.s[0:5]         // don't write back pointer or cap
    x.s = x.s[:5]          // don't write back pointer or cap
    x.s = x.s[:5:7]        // don't write back pointer
    
    There is more to be done here, for example:
    
    x.s = x.s[:len(x.s):7] // don't write back ptr or len
    
    This CL can't handle that one yet.
    
    Fixes #14855
    
    Change-Id: Id1e1a4fa7f3076dc1a76924a7f1cd791b81909bb
    Reviewed-on: https://go-review.googlesource.com/20954Reviewed-by: 's avatarAustin Clements <austin@google.com>
    Run-TryBot: Keith Randall <khr@golang.org>
    d4663e13
Name
Last commit
Last update
.github Loading commit data...
api Loading commit data...
doc Loading commit data...
lib/time Loading commit data...
misc Loading commit data...
src Loading commit data...
test Loading commit data...
.gitattributes Loading commit data...
.gitignore Loading commit data...
AUTHORS Loading commit data...
CONTRIBUTING.md Loading commit data...
CONTRIBUTORS Loading commit data...
LICENSE Loading commit data...
PATENTS Loading commit data...
README.md Loading commit data...
favicon.ico Loading commit data...
robots.txt Loading commit data...