[llvm-bugs] [Bug 33752] New: Function std::terminate can be created without type metadata resulting in assertion failure linking libc++ with ThinLTO + cfi-icall

via llvm-bugs llvm-bugs at lists.llvm.org
Tue Jul 11 16:25:13 PDT 2017


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

            Bug ID: 33752
           Summary: Function std::terminate can be created without type
                    metadata resulting in assertion failure linking libc++
                    with ThinLTO + cfi-icall
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Interprocedural Optimizations
          Assignee: unassignedbugs at nondot.org
          Reporter: peter at pcc.me.uk
                CC: llvm-bugs at lists.llvm.org

$ cat term.cpp
namespace test0 {
void foo() {}

struct A {
  A();
  ~A();
};

void test() noexcept {
  A a;
  foo();
}
}  // namespace test0

namespace std {
void terminate() {}
}

void f(void (*p)()) {
  p();
}

void *g();

int main(int argc, char **argv) {
  f((void (*)())g());
}
$ cat term2.cpp
namespace std {

void terminate();

}

void * g() {
  return (void *)&std::terminate;
}
$ ~/src2/llvm-project/ra/bin/clang -fsanitize=cfi-icall  term.cpp term2.cpp 
-flto=thin -std=c++11 -fuse-ld=lld
ld.lld: lib/Transforms/IPO/LowerTypeTests.cpp:860: void (anonymous
namespace)::LowerTypeTestsModule::importFunction(llvm::Function *, bool):
Assertion `isDefinition' failed.

-- 
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/20170711/8b8287a3/attachment.html>


More information about the llvm-bugs mailing list