cmd/compile: remove NUL-terminator from string data

Makes godoc 37KB smaller.
For #6853.

Change-Id: I0bd6e40f2b4da193768a9fc2ce494cacf7e83c32
Reviewed-on: https://go-review.googlesource.com/19697
Run-TryBot: David Crawshaw <crawshaw@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
This commit is contained in:
David Crawshaw 2016-02-18 11:08:25 -05:00
parent 62e26e7511
commit 08c2cd8469
2 changed files with 2 additions and 2 deletions

View File

@ -233,7 +233,6 @@ func stringsym(s string) (hdr, data *Sym) {
off = dsname(symdata, off, s[n:n+m])
}
off = duint8(symdata, off, 0) // terminating NUL for runtime
ggloblsym(symdata, int32(off), obj.DUPOK|obj.RODATA|obj.LOCAL)
return symhdr, symdata

View File

@ -217,7 +217,8 @@ func decodetype_structfieldname(s *LSym, i int) string {
if r == nil { // shouldn't happen.
return ""
}
return cstring(r.Sym.P[r.Add:])
strlen := int64(decode_inuxi(s.P[Thearch.Ptrsize:], Thearch.Intsize))
return string(r.Sym.P[r.Add : r.Add+strlen])
}
func decodetype_structfieldtype(s *LSym, i int) *LSym {