Commit 08c2cd84 authored by David Crawshaw's avatar David Crawshaw

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: 's avatarBrad Fitzpatrick <bradfitz@golang.org>
parent 62e26e75
......@@ -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
......
......@@ -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 {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment