golang/go

cmd/asm: nil deref in LOOP (PC)

dvyukov opened this issue · 2 comments

cmd/asm crashes on the following special kind of modem noise:

TEXT C(SB),$0
LOOP(PC)
panic: runtime error: invalid memory address or nil pointer dereference
[signal 0xb code=0x1 addr=0xf6 pc=0x57b0a7]

goroutine 1 [running]:
cmd/internal/obj/x86.xfol(0xc820116000, 0xc820122140, 0xc82007d7a8)
    src/cmd/internal/obj/x86/obj6.go:1174 +0x357
cmd/internal/obj/x86.follow(0xc820116000, 0xc82011e000)
    src/cmd/internal/obj/x86/obj6.go:965 +0xca
cmd/internal/obj.Writeobjdirect(0xc820116000, 0xc82000a360)
    src/cmd/internal/obj/objfile.go:295 +0x30f
main.main()
    src/cmd/asm/main.go:65 +0xd9b

go version devel +5512ac2 Wed Sep 16 17:56:14 2015 +0000 linux/amd64

As far as I can tell, this is a valid (ish) assembly program and obj is mishandling it. Reassigning.

Can't be reproduced since go1.9 (and above).