Commit e546ef12 authored by Ian Lance Taylor's avatar Ian Lance Taylor

cmd/internal/obj/s390x: don't crash on invalid instruction

I didn't bother with a test as there doesn't seem to be an existing
framework for testing assembler failures, and tests for invalid code
aren't all that interesting.

Fixes #26700

Change-Id: I719410d83527802a09b9d38625954fdb36a3c0f7
Reviewed-on: https://go-review.googlesource.com/c/153177
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Reviewed-by: 's avatarMichael Munday <mike.munday@ibm.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
parent 276870d6
......@@ -2618,6 +2618,10 @@ func (c *ctxtz) branchMask(p *obj.Prog) uint32 {
func (c *ctxtz) asmout(p *obj.Prog, asm *[]byte) {
o := c.oplook(p)
if o == nil {
return
}
switch o.type_ {
default:
c.ctxt.Diag("unknown type %d", o.type_)
......
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