summaryrefslogtreecommitdiff
path: root/src/runtime/print.go
diff options
context:
space:
mode:
authorMartin Möhrmann <martisch@uos.de>2016-09-06 10:38:16 +0200
committerBrad Fitzpatrick <bradfitz@golang.org>2016-09-08 15:57:01 +0000
commit252093f1203da13e1face4f71141ac75482ccf11 (patch)
tree85b2a2d2399fe7b419db10c440ba6f34a3d7c450 /src/runtime/print.go
parentfd975c6aa535f2aa066653235be992731d691cfb (diff)
downloadgo-git-252093f1203da13e1face4f71141ac75482ccf11.tar.gz
runtime: remove maxstring
Before this CL the runtime prevented printing of overlong strings with the print function when the length of the string was determined to be corrupted. Corruption was checked by comparing the string size against the limit which was stored in maxstring. However maxstring was not updated everywhere were go strings were created e.g. for string constants during compile time. Thereby the check for maximum string length prevented the printing of some valid strings. The protection maxstring provided did not warrant the bookkeeping and global synchronization needed to keep maxstring updated to the correct limit everywhere. Fixes #16999 Change-Id: I62cc2f4362f333f75b77f199ce1a71aac0ff7aeb Reviewed-on: https://go-review.googlesource.com/28813 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
Diffstat (limited to 'src/runtime/print.go')
-rw-r--r--src/runtime/print.go4
1 files changed, 0 insertions, 4 deletions
diff --git a/src/runtime/print.go b/src/runtime/print.go
index 32626c1e9d..5f82335244 100644
--- a/src/runtime/print.go
+++ b/src/runtime/print.go
@@ -199,10 +199,6 @@ func printpointer(p unsafe.Pointer) {
}
func printstring(s string) {
- if uintptr(len(s)) > maxstring {
- gwrite(bytes("[string too long]"))
- return
- }
gwrite(bytes(s))
}