csmith-project / creduce

C-Reduce, a C and C++ program reducer
Other
1.25k stars 123 forks source link

Assertion failure with `simple-inliner` #236

Closed aytey closed 2 years ago

aytey commented 3 years ago

As reported in https://github.com/marxin/cvise/issues/58

For:

clang_delta --version
clang_delta 2.11.0
Git version: 3e1f5a1

(that is, I'm using the llvm-11.0 branch of creduce)

with:

llvm-config --version
11.0.1

and on the following file:

struct a;
template <typename> using b = a;
struct a {
  template <typename c> auto d(c) {
    using e = b<c>;
    return e{};
  }
} f;
auto g() -> a {
  a h;
  f.d([] {}).d(g());
  return h;
}

we get:

clang_delta --transformation=simple-inliner --counter=1 58.cpp
clang_delta: SimpleInliner.cpp:282: virtual void SimpleInliner::HandleTranslationUnit(clang::ASTContext&): Assertion `TheStmt && "NULL TheStmt!"' failed.
[1]    62598 IOT instruction (core dumped)  ../clang_delta --transformation=simple-inliner --counter=1 58.cpp
chenyang78 commented 2 years ago

Fixed in 98c3f5d. Thank you, @andrewvaughanj !