Skip to content

cmd/internal/obj/x86: imprecise "offset overflow" error message on AMD64 #24871

@quasilyte

Description

@quasilyte

CL59630 introduced additional offset overflow checks for AMD64.

This issue reports regression in error message quality.

What did you do?

Assemble this file with go tool asm on AMD64 platform:

TEXT badOffset(SB), 0, $0
        MOVL 999999999999(AX), AX
        RET

What did you expect to see?

Error about offset (displacement) overflow.
Something like "offset too large".

What did you see instead?

Generic "invalid instruction" error.

go tool asm foo.s
asm: invalid instruction: 00000 (foo.s:2)	MOVL	999999999999(AX), AX
asm: assembly failed

Note: it works on GOARCH=386 as expected:

GOARCH=386 go tool asm foo.s
asm: offset too large in 00018 (foo.s:2)	MOVL	999999999999(AX), AX
asm: assembly failed

Related to #21860.

Metadata

Metadata

Assignees

No one assigned

    Labels

    FrozenDueToAgeNeedsFixThe path to resolution is known, but the work has not been done.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions