[llvm-bugs] [Bug 49416] New: Converting between pointers to signed and unsigned _ExtInt causes crash

via llvm-bugs llvm-bugs at lists.llvm.org
Wed Mar 3 11:50:09 PST 2021


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

            Bug ID: 49416
           Summary: Converting between pointers to signed and unsigned
                    _ExtInt causes crash
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: C
          Assignee: unassignedclangbugs at nondot.org
          Reporter: wilcoxjay at gmail.com
                CC: blitzrakete at gmail.com, dgregor at apple.com,
                    erik.pilkington at gmail.com, llvm-bugs at lists.llvm.org,
                    richard-llvm at metafoo.co.uk

The following code causes clang trunk to crash.

// -----------------------------
// https://godbolt.org/z/z138v6
// -----------------------------

void f(unsigned _ExtInt(32)* n);

void g(_ExtInt(32)* n) {
    f(n);
}

// -----------------------------

It's unclear to me whether this program is intended to be supported by _ExtInt
or not, but in either case, it should not cause a crash.

Inserting a cast seems to work around the problem:

// -----------------------------
// https://godbolt.org/z/nKKPY7
// -----------------------------

void f(unsigned _ExtInt(32)* n);

void g(_ExtInt(32)* n) {
    f((unsigned _ExtInt(32)*)n);
}

// -----------------------------

-- 
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/20210303/d3174dd6/attachment.html>


More information about the llvm-bugs mailing list