[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[creduce-bugs] Assertion `Offset+NumBytes <= size() && "Invalid region to erase!"' failed.



 % "/home/markus/creduce/creduce/../clang_delta/clang_delta" --transformation=remove-nested-function --counter=10  array.ii
clang_delta: /home/markus/llvm/tools/clang/include/clang/Rewrite/Core/RewriteRope.h:203: void clang::RewriteRope::erase(unsigned int, unsigned int): Assertion `Offset+NumBytes <= size() && "Invalid region to erase!"' failed.

-- 
Markus
creduce 2.5.0
9b6d912faaac
Linux
x4
4.5.0-rc1-00179-gad0b40fa9446-dirty
#120 SMP Sat Jan 30 08:39:08 CET 2016
x86_64

***************************************************

pass_clang::remove-nested-function has encountered a bug:
crashed: "/home/markus/creduce/creduce/../clang_delta/clang_delta" --transformation=remove-nested-function --counter=10 /tmp/creduce-zpiFYw/array.ii

Please consider tarring up /var/tmp/creduce_bug_000
and mailing it to creduce-bugs@flux.utah.edu and we will try to fix
the bug.

This bug is not fatal, C-Reduce will continue to execute.

***************************************************

typedef int size_t;
template <typename _Tp, long _Nm> struct __array_traits {
  typedef _Tp _Type[_Nm];
  static _Tp &_S_ref(const _Type &__t, size_t __n) {
    return const_cast<_Tp &>(__t[__n]);
  }
};
template <typename _Tp, long _Nm> struct Trans_NS_std_array {
  typedef _Tp value_type;
  typedef value_type &const_reference;
  typedef long size_type;
  typedef __array_traits<_Tp, _Nm> _AT_Type;
  typename _AT_Type::_Type _M_elems;
  value_type &operator[](size_type __n) {
    return _AT_Type::_S_ref(_M_elems, __n);
  }
  const_reference operator[](size_type __n) const {
    return _AT_Type::_S_ref(_M_elems, __n);
  }
};


int t ;
void foo(int px, int &py) {
  if ((t & 1) == 0) {
    if (px != 1)
      __builtin_abort();
    if (py != 2)
      __builtin_abort();
  }
  t++;
}
void test1(const Trans_NS_std_array<int, 2> &) __attribute__((noinline));
void test1(const Trans_NS_std_array<int, 2> &p) { foo(p[0], p[1]); }
void test(Trans_NS_std_array<Trans_NS_std_array<int, 2>, 2> &t) {
  test1(t[0]);
  test1(t[1]);
  foo(t[0][0], t[0][1]);
}
int main() {
  Trans_NS_std_array<Trans_NS_std_array<int, 2>, 2> t;
  t[0][0] = 1;
  t[0][1] = 2;
  test(t);
}