[llvm-bugs] [Bug 52405] New: Integrated assembler allows trailing instruction prefixes

via llvm-bugs llvm-bugs at lists.llvm.org
Thu Nov 4 08:28:54 PDT 2021


https://bugs.llvm.org/show_bug.cgi?id=52405

            Bug ID: 52405
           Summary: Integrated assembler allows trailing instruction
                    prefixes
           Product: clang
           Version: unspecified
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: -New Bugs
          Assignee: unassignedclangbugs at nondot.org
          Reporter: me at smitop.com
                CC: htmldeveloper at gmail.com, llvm-bugs at lists.llvm.org,
                    neeilans at live.com, richard-llvm at metafoo.co.uk

The LLVM integrated assembler incorrectly allows x86 instruction prefixes (like
LOCK) without an actual instruction being prefixed. This should be rejected
since LOCK isn't valid by itself: it's an instruction prefix that needs to be
followed by an actual instruction. For example:

    int main() {
        __asm__("lock");
    }

The result is "Illegal instruction (core dumped)", since LOCK by itself isn't
an instruction. This issue also occurs with (unstable) inline assembly in Rust
(https://github.com/rust-lang/rust/issues/82314).

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20211104/03b62909/attachment.html>


More information about the llvm-bugs mailing list