[llvm] [MC][x86] Fix missing check in MC binary expression (PR #75693)

Phoebe Wang via llvm-commits llvm-commits at lists.llvm.org
Sat Dec 16 02:38:02 PST 2023


https://github.com/phoebewang requested changes to this pull request.

I found a problem when built it locally:

```
$ echo 'setb %al %rbx' | llvm-mc --show-encoding
        .text
        setb    (%al)%rbx                       # encoding: [0x0f,0x92,0x04,0x25,A,A,A,A]
                                        #   fixup A - offset: 4, value: (%al)%rbx, kind: reloc_signed_4byte
```

In this case, `%rbx` is taken as a relocation, which is incorrect.
I think the `cast` is intended here. What we should do is to make it user friendly by emitting an error with message. But it seems not easy to do here.

https://github.com/llvm/llvm-project/pull/75693


More information about the llvm-commits mailing list