mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
cmd/8g: don't call gc.Fatal during initalisation
Fixes #10592 Calling gc.Fatal before gc.Main has been called ends up flushing gc.bstdout before it is properly set up. Ideally obj.Bflush would handle this case, but that type and its callers are rather convoluted, so take the simpler route and avoid calling gc.Fatal altogether. Change-Id: I338b469e86edba558b6bedff35bb904bfc3d6990 Reviewed-on: https://go-review.googlesource.com/9525 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Reviewed-by: Dave Cheney <dave@cheney.net> Run-TryBot: Dave Cheney <dave@cheney.net> TryBot-Result: Gobot Gobot <gobot@golang.org>
This commit is contained in:
parent
042200145f
commit
443a32e707
1 changed files with 4 additions and 1 deletions
|
|
@ -8,6 +8,8 @@ import (
|
||||||
"cmd/internal/gc"
|
"cmd/internal/gc"
|
||||||
"cmd/internal/obj"
|
"cmd/internal/obj"
|
||||||
"cmd/internal/obj/x86"
|
"cmd/internal/obj/x86"
|
||||||
|
"fmt"
|
||||||
|
"os"
|
||||||
)
|
)
|
||||||
|
|
||||||
var thechar int = '8'
|
var thechar int = '8'
|
||||||
|
|
@ -58,7 +60,8 @@ func main() {
|
||||||
gc.Thearch.FREGMIN = x86.REG_X0
|
gc.Thearch.FREGMIN = x86.REG_X0
|
||||||
gc.Thearch.FREGMAX = x86.REG_X7
|
gc.Thearch.FREGMAX = x86.REG_X7
|
||||||
default:
|
default:
|
||||||
gc.Fatal("unsupported setting GO386=%s", v)
|
fmt.Fprintf(os.Stderr, "unsupported setting GO386=%s\n", v)
|
||||||
|
os.Exit(1)
|
||||||
}
|
}
|
||||||
gc.Thearch.MAXWIDTH = MAXWIDTH
|
gc.Thearch.MAXWIDTH = MAXWIDTH
|
||||||
gc.Thearch.ReservedRegs = resvd
|
gc.Thearch.ReservedRegs = resvd
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue