1
0
mirror of https://github.com/golang/go synced 2024-11-20 08:54:40 -07:00

gc: put limit on size of exported recursive interface

Prevents edge-case recursive types from consuming excessive memory.

Fixes #1909.

R=golang-dev, lvd, rsc
CC=golang-dev
https://golang.org/cl/5504108
This commit is contained in:
Lorenzo Stoakes 2012-01-09 11:48:53 -05:00 committed by Russ Cox
parent 2cb6fcf63f
commit aa63a928ea

View File

@ -1450,7 +1450,7 @@ Tconv(Fmt *fp)
if(t == T)
return fmtstrcpy(fp, "<T>");
if(t->trecur > 4)
if(t->trecur > 4 || fp->nfmt > 1000)
return fmtstrcpy(fp, "<...>");
t->trecur++;