Commit 85d6a29a authored by Josh Bleecher Snyder's avatar Josh Bleecher Snyder

cmd/compile: prevent infinite recursion printing types in Fatalf

Updates #20162

Change-Id: Ie289bae0d0be8430e492ac73fd6e6bf36991d4a1
Reviewed-on: https://go-review.googlesource.com/42130Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
parent 65119318
......@@ -183,6 +183,11 @@ func dowidth(t *types.Type) {
}
if sizeCalculationDisabled {
if t.Broke() {
// break infinite recursion from Fatal call below
return
}
t.SetBroke(true)
Fatalf("width not calculated: %v", t)
}
......
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