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: unassignedclangb...@nondot.org
          Reporter: wilcox...@gmail.com
                CC: blitzrak...@gmail.com, dgre...@apple.com,
                    erik.pilking...@gmail.com, llvm-bugs@lists.llvm.org,
                    richard-l...@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.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to