mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
cmd/compile: enforce 32-bit restrictions on ops
Most 64-bit x86 ops can only take a signed 32-bit constant. Clean up our rewrite rules to enforce this restriction. Modify the assembler to fail if the offset does not fit in the instruction. That last check triggers a few times on weird testing code. Suppress those errors if the compiler itself generated errors. Fixes #14862 Change-Id: I76559af035b38483b1e59621a8029fc66b3a5d1e Reviewed-on: https://go-review.googlesource.com/20815 Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
This commit is contained in:
parent
d246eedcaa
commit
8dc04cbedc
5 changed files with 454 additions and 364 deletions
|
|
@ -1309,6 +1309,10 @@ func funccompile(n *Node) {
|
|||
breakpc = nil
|
||||
Funcdepth = 0
|
||||
dclcontext = PEXTERN
|
||||
if nerrors != 0 {
|
||||
// If we have compile errors, ignore any assembler/linker errors.
|
||||
Ctxt.DiagFunc = func(string, ...interface{}) {}
|
||||
}
|
||||
flushdata()
|
||||
obj.Flushplist(Ctxt) // convert from Prog list to machine code
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue