mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
cmd/asm: reject foo(SB)(AX) instead of silently treating as foo(SB)
Add test for assembly errors, to verify fix. Make sure invalid instruction errors are printed just once (was printing them once per span iteration, so typically twice). Fixes #13282. Change-Id: Id5f66f80a80b3bc4832e00084b0a91f1afec7f8f Reviewed-on: https://go-review.googlesource.com/18858 Reviewed-by: Rob Pike <r@golang.org>
This commit is contained in:
parent
544f28a25e
commit
9d6427d899
6 changed files with 135 additions and 7 deletions
|
|
@ -54,7 +54,7 @@ func main() {
|
|||
lexer := lex.NewLexer(flag.Arg(0), ctxt)
|
||||
parser := asm.NewParser(ctxt, architecture, lexer)
|
||||
diag := false
|
||||
ctxt.Diag = func(format string, args ...interface{}) {
|
||||
ctxt.DiagFunc = func(format string, args ...interface{}) {
|
||||
diag = true
|
||||
log.Printf(format, args...)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue