-
Notifications
You must be signed in to change notification settings - Fork 14.9k
Open
Labels
Description
I am reporting an assembly bug found during research.
The tests were conducted using the latest version (Clang 19.1.0)
The issue occurs in the same way with previous versions as well.
When some register names are used in operands, Clang interprets them as
actual registers. Notably, Clang allows the creation of these labels,
which could potentially lead to problems.
- Example Code
.intel_syntax noprefix
.data
RAX:
RbX:
Rcx:
.long 0
.text
test:
mov edx, DWORD PTR [RAX]
mov edx, DWORD PTR [RbX]
mov edx, DWORD PTR [Rcx]
call rsP
rsP:
ret
- Compilation Command
Clang -c test.c
- Compiled Binary Output
0000000000000000 <test>:
0: 8b 10 mov edx,DWORD PTR [rax]
2: 8b 13 mov edx,DWORD PTR [rbx]
4: 8b 11 mov edx,DWORD PTR [rcx]
6: ff d4 call rsp
0000000000000008 <rsP>:
8: c3 ret