29.07.2013, 12:42, "Konstantin Tokarev" <[email protected]>:
> Hi all,
>
> A couple of times I got clang_delta running infinitely with 100% CPU load. It 
> would be great if there was some pre-defined or adpative time limit for it.
>

Attached test case for clang_delta hanging.

-- 
Regards,
Konstantin
    typedef int        pthread_mutex_t;
          enum __rw_fmtflags {     __rw_boolalpha ,     __rw_dec ,     __rw_fixed ,     __rw_hex ,     __rw_internal ,     __rw_left ,     __rw_oct ,     __rw_right ,     __rw_scientific ,     __rw_showbase ,     __rw_showpoint ,     __rw_showpos ,     __rw_skipws ,     __rw_unitbuf ,     __rw_uppercase ,     __rw_bin ,     __rw_basefield ,     __rw_adjustfield ,     __rw_floatfield ,     __rw_nolock ,     __rw_nolockbuf  };
 enum __rw_iostate {     __rw_goodbit ,     __rw_badbit ,     __rw_eofbit ,     __rw_failbit ,      _ };
 enum __rw_openmode {     __rw_app ,     __rw_binary ,     __rw_in ,     __rw_out ,     __rw_in_out ,     __rw_trunc ,     __rw_ate ,     __rw_nocreate ,     __rw_noreplace ,     __rw_stdio ,     __rw_native  };
 inline __rw_openmode& operator|= (__rw_openmode &__lhs, __rw_openmode __rhs) { return __lhs = __rw_openmode (long (__lhs) | __rhs); }
  ;
 inline __rw_openmode operator| (__rw_openmode __lhs, __rw_openmode __rhs) { return __lhs |= __rhs; }
 enum __rw_seekdir {     __rw_beg ,     __rw_cur ,     __rw_end  };
        namespace std { template <class _Iterator> struct iterator_traits ; struct input_iterator_tag { };  struct forward_iterator_tag : public input_iterator_tag { };  struct random_access_iterator_tag : public forward_iterator_tag { }; template <class _TypeT> struct iterator_traits {          typedef long difference_type;          typedef int& reference;     typedef random_access_iterator_tag iterator_category; }; template <class _TypeT> struct iterator_traits<const _TypeT*> {     typedef _TypeT value_type;     typedef long difference_type;     typedef const value_type* pointer;     typedef const value_type& reference;     typedef random_access_iterator_tag iterator_category; };  struct iterator {                    typedef void reference;      }; template <class _TypeT> void  __iterator_category (void) ; template <class _Category, class _TypeT, class _Distance,           class _Pointer, class _Reference> void  __iterator_category (void) ; template <class _Tag> void  __is_input_iterator (void) ; template <class _Tag> void  __is_bidirectional_iterator (void) ; template <class _Tag> void  __is_random_access_iterator (void) ; ; template <class _Iterator> void  __value_type (void) ; template <class _Iterator> void  __distance_type (void) ; template <class _InputIterator, class _Distance> inline void __advance (_InputIterator &__it, _Distance __n, input_iterator_tag) ; template <class _ForwardIterator, class _Distance> inline void __advance ( void) ; template <class _BidirectionalIterator, class _Distance> inline void __advance (void) ; template <class _RandomAccessIterator, class _Distance> inline void __advance (_RandomAccessIterator& __it, _Distance __n,                        random_access_iterator_tag) {     __it += __n; } template <class _InputIterator, class _Distance> inline void advance (_InputIterator& __it, _Distance __n) {     __advance (__it, __n, typename std::iterator_traits< _InputIterator >::iterator_category ()); } template <class _InputIterator, class _Distance> inline void __distance (const _InputIterator &__first,                         const _InputIterator &__last,                         _Distance &__n,                         input_iterator_tag) ; template <class _ForwardIterator, class _Distance> inline void __distance (                         void) ; template <class _BidirectionalIterator, class _Distance> inline void __distance (                         void) ; template <class _RandomAccessIterator, class _Distance> inline void __distance (const _RandomAccessIterator &__first,                         const _RandomAccessIterator &__last,                         _Distance &__n,                         random_access_iterator_tag) {     __n = __last - __first; } template <class _ForwardIterator> inline typename iterator_traits<_ForwardIterator>::difference_type distance (_ForwardIterator __first, _ForwardIterator __last) {     typename iterator_traits<_ForwardIterator>::difference_type __n = 0;     __distance (__first, __last, __n,                 typename std::iterator_traits< _ForwardIterator >::iterator_category ());     return __n; } template <class _ForwardIterator, class _Distance> inline void distance (                       void) ; }
       namespace std { template <class _Iterator> class reverse_iterator     : public iterator {     typedef _Iterator  traits_type; public:     typedef typename traits_type::difference_type difference_type;     typedef typename traits_type::value_type value_type;     typedef typename traits_type::pointer pointer;     typedef typename traits_type::reference reference;          template <class _TypeU>     void  base () const      ;      ;      ; protected:     _Iterator current; }; template <class _Iterator> void  operator== (const reverse_iterator <_Iterator>& __x,                         const reverse_iterator <_Iterator>& __y) ; template <class _Iterator> void  operator< (const reverse_iterator <_Iterator>& __x,                        const reverse_iterator <_Iterator>& __y) ; template <class _Iterator> void  operator!= (const reverse_iterator <_Iterator>& __x,                         const reverse_iterator <_Iterator>& __y) ; template <class _Iterator> void  operator> (const reverse_iterator <_Iterator>& __x,                        const reverse_iterator <_Iterator>& __y) ; template <class _Iterator> void  operator>= (const reverse_iterator <_Iterator>& __x,                         const reverse_iterator <_Iterator>& __y) ; template <class _Iterator> void  operator<= (const reverse_iterator <_Iterator>& __x,                         const reverse_iterator <_Iterator>& __y) ; template <class _Iterator> void  operator- (const reverse_iterator <_Iterator>& __x,            const reverse_iterator <_Iterator>& __y) ; template <class _Iterator> void  operator+ (typename iterator_traits<_Iterator>::difference_type __n,            const reverse_iterator <_Iterator>& __x) ;  class back_insert_iterator: public iterator { public:           ; protected:     int container; };    class front_insert_iterator: public iterator { public:           ; protected:     int container; }; template <class _Container> void  front_inserter (void) ; template <class _Container> class insert_iterator: public iterator { public:     typedef _Container container_type;      ; protected:     typename container_type::iterator iter;     container_type container; }; template <class _Container, class _Iterator> void  inserter ( void) ; }
                      void __rw_throw (int, ...);
           template <class _TypeT> struct __rw_select_int {     typedef void* _SelectT; };
 template struct __rw_select_int<long long> ;
 template struct __rw_select_int<wchar_t> ;
             template <class _Container> inline typename _Container::size_type __rw_new_capacity (typename _Container::size_type __size, const _Container*) {     typedef typename _Container::size_type _RWSizeT;     const _RWSizeT __ratio = _RWSizeT  (8 < 0)                                        / 1000;     const _RWSizeT __cap = __size > 0 * __ratio                            + (0 * __ratio >> 0);     return __size += 2 > __cap; }
        namespace std {  template <class _TypeT> class allocator; template<> class allocator<void> { public:     typedef void value_type;     typedef value_type* pointer;     typedef const value_type* const_pointer;           }; template <class _TypeT> class allocator { public:     typedef unsigned long size_type;     typedef long difference_type;     typedef _TypeT value_type;     typedef value_type* pointer;     typedef const value_type* const_pointer;     typedef value_type& reference;     typedef const value_type& const_reference;     allocator () ;          struct rebind ;     template <class _TypeU>     allocator (void) ;     template <class _TypeU>     void      operator= (const allocator&) ;      ;     pointer allocate (size_type __n, allocator<void>::const_pointer = 0) ;     void deallocate (pointer __p, size_type __n)     ;      ;      ;     void destroy (pointer __p) ; }; template <class _TypeT> class allocator ; template <class _TypeT, class _TypeU> inline bool operator== (const allocator<_TypeT>&, const allocator<_TypeU>&) {     return true; } template <class _TypeT, class _TypeU> void  operator!= (const allocator<_TypeT>& __x,             const allocator<_TypeU>& __y) ; }
       namespace std { class exception ; }
        using std::exception;
  class __rw_mutex { public:  public:      ;     ;     ;      private:     ;     ;     pthread_mutex_t _C_mutex;};
  struct __rw_synchronized {      };
            namespace std {    template <class _CharT> struct char_traits; template <class _CharT> struct char_traits ; template<> struct char_traits<char> {          typedef int int_type;     typedef long off_type;          typedef int pos_type;     static int_type eof  ;     ;     static bool lt  ;      ;     static unsigned long length (const char *__s) {         return __builtin_strlen (__s);     }     static char     copy  ;     static bool eq_int_type  ;     static char to_char_type  ;     static int_type to_int_type  ; }; template<> struct char_traits<wchar_t> {          typedef unsigned int_type;     typedef long off_type;          typedef int pos_type;     static bool eq  ; }; }
           struct __null_ref      {     int _C_eos;                           ;      ;           ;                    };
        namespace std { template < class _Traits, class _Allocator> class basic_string: private std::allocator<char> { public:          typedef char value_type;          typedef __null_ref      _C_string_ref_type;          typedef std::allocator<char>         _C_ref_alloc_type;          typedef long difference_type;     typedef typename std::allocator<char>::reference reference;     typedef typename std::allocator<char>::const_reference const_reference;               typedef typename std::allocator<char>::pointer iterator;           ;          typedef std::reverse_iterator<iterator> reverse_iterator;     static const unsigned long npos = typename std::allocator<char>::size_type (446744073709551615);     explicit basic_string (const std::allocator<char> &__alloc = std::allocator<char> ())         :  _C_data () { }     ;     ;     ;     ;     ;     template <class _InputIter>     basic_string (void);     ;     iterator begin ;     iterator end  ;      ;      ;      ;      ;     ;     ;      ;     ;      ;      ;     ;     ;     ;     ;     ;     ;     template<class _InputIter>     basic_string& append ( void) ;     template<class _InputIter>     void  append ( void) ;     ;     ;     ;      ;     template<class _InputIter>     void  assign (void) ;     template<class _InputIter>     basic_string& assign (  void) ;     ;     ;      ;     template<class _InputIter>     void insert ( void) ;     template <class _InputIter>     void insert (iterator __p) ;      ;     ;      ; private:     static unsigned long _C_min  ; public:     template <class _InputIter>     void  __replace_aux (void);     ; public:     ;     ;     ;      ;      ;     template<class _InputIter>     void      replace ( iterator __last1);     template<class _InputIter>     void      replace (                void) ;     ;      ;      ;      ;      ;     ;     ;     ;      ;     ;      ;     ;      ;     ;      ;     ;      ;     ;     ;     ;      ;     ; private:      ;     ;      ;     ;     friend struct __null_ref;     static __null_ref _C_null_ref;     static __null_ref _C_nullref  ;     _C_string_ref_type  _C_get_rep ;     typename std::allocator<char>::pointer _C_data; };   template <class _CharT, class _Traits , class _Allocator> void  operator+ (const basic_string< _Traits, _Allocator> &__lhs,            const basic_string< _Traits, _Allocator> &__rhs) ; template <class _CharT, class _Traits , class _Allocator> void  operator+ (const _CharT* __lhs,            const basic_string< _Traits, _Allocator>& __rhs) ; template <class _CharT, class _Traits , class _Allocator> void  operator+ (_CharT __lhs,            const basic_string< _Traits, _Allocator>& __rhs) ; template <class _CharT, class _Traits , class _Allocator> void  operator+ (const basic_string< _Traits, _Allocator>& __lhs,            const _CharT* __rhs) ; template <class _CharT, class _Traits , class _Allocator> void  operator+ (const basic_string< _Traits, _Allocator>& __lhs,            _CharT __rhs) ; template <class _CharT, class _Traits , class _Allocator> void  operator== (const basic_string< _Traits, _Allocator>& __lhs,             const basic_string< _Traits, _Allocator>& __rhs) ; template <class _CharT, class _Traits , class _Allocator> inline bool operator== (const _CharT* __lhs,             const basic_string< _Traits, _Allocator>& __rhs) {       unsigned long __trans_tmp_1;     const char *__s = __lhs;                __trans_tmp_1 =  __builtin_strlen (__s);                   const typename _Allocator::size_type         __n = __trans_tmp_1;     return 0 == __n            && !0; } template <class _CharT, class _Traits , class _Allocator> inline bool operator== (const basic_string< _Traits, _Allocator>& __lhs,             const _CharT* __rhs) {     return __rhs == __lhs; } template <class _CharT, class _Traits , class _Allocator> void  operator< (const basic_string< _Traits, _Allocator>& __lhs,            const basic_string< _Traits, _Allocator>& __rhs) ; template <class _CharT, class _Traits , class _Allocator> void  operator< (const _CharT* __lhs,            const basic_string< _Traits, _Allocator>& __rhs) ; template <class _CharT, class _Traits , class _Allocator> void  operator< (const basic_string< _Traits, _Allocator>& __lhs,            const _CharT* __rhs) ; template <class _CharT, class _Traits , class _Allocator> void  operator!= (const basic_string< _Traits, _Allocator>& __lhs,             const basic_string< _Traits, _Allocator>& __rhs) ; template <class _CharT, class _Traits , class _Allocator> void  operator> (const basic_string< _Traits, _Allocator>& __lhs,            const basic_string< _Traits, _Allocator>& __rhs) ; template <class _CharT, class _Traits , class _Allocator> void  operator<= (const basic_string< _Traits, _Allocator>& __lhs,             const basic_string< _Traits, _Allocator>& __rhs) ; template <class _CharT, class _Traits , class _Allocator> void  operator>= (const basic_string< _Traits, _Allocator>& __lhs,             const basic_string< _Traits, _Allocator>& __rhs) ; template <class _CharT, class _Traits, class _Allocator> inline void swap (                   void) ; template <class _CharT, class _Traits , class _Allocator> void  operator!= (const _CharT* __lhs,             const basic_string< _Traits, _Allocator>& __rhs) ; template <class _CharT, class _Traits , class _Allocator> void  operator!= (const basic_string< _Traits, _Allocator>& __lhs,             const _CharT* __rhs) ; template <class _CharT, class _Traits , class _Allocator> void  operator> (const _CharT* __lhs,            const basic_string< _Traits, _Allocator>& __rhs) ; template <class _CharT, class _Traits , class _Allocator> void  operator> (const basic_string< _Traits, _Allocator>& __lhs,            const _CharT* __rhs) ; template <class _CharT, class _Traits , class _Allocator> void  operator<= (const _CharT* __lhs,             const basic_string< _Traits, _Allocator>& __rhs) ; template <class _CharT, class _Traits , class _Allocator> void  operator<= (const basic_string< _Traits, _Allocator>& __lhs,             const _CharT* __rhs) ; template <class _CharT, class _Traits , class _Allocator> void  operator>= (const _CharT* __lhs,             const basic_string< _Traits, _Allocator>& __rhs) ; template <class _CharT, class _Traits , class _Allocator> void  operator>= (const basic_string< _Traits, _Allocator>& __lhs,             const _CharT* __rhs) ; }
       namespace std { template <class _TypeT> class allocator; template <class _CharT, class _Traits = char_traits<_CharT> > class basic_ios;   template <class _CharT, class _Traits = char_traits<_CharT> > class basic_streambuf;   template <class _CharT > class basic_istream; template <class _CharT, class _Traits = char_traits<_CharT> > class basic_iostream;  typedef basic_iostream<char> iostream;   template <class _CharT, class _Traits = char_traits<_CharT> > class basic_ostream;   template <class _CharT,           class _Traits = char_traits<_CharT> > class basic_stringbuf; template <class _CharT,           class _Traits = char_traits<_CharT> > class basic_istringstream; template <class _CharT,           class _Traits = char_traits<_CharT> > class basic_ostringstream; template <class _CharT,           class _Traits = char_traits<_CharT> > class basic_stringstream;                    typedef int fstream;             }
         enum __rw_locale_category {     __rw_cat_none ,     __rw_cat_collate ,     __rw_cat_ctype ,     __rw_cat_monetary ,     __rw_cat_numeric ,     __rw_cat_time ,     __rw_cat_messages ,     __rw_cat_all  };
        namespace std { template <class _Facet> void  use_facet (void ) ; template <class _Facet> void  has_facet (void ) ;                                       template < class _Iter> struct money_get;                              struct num_get;          struct num_put;                              struct time_put;         template <class _CharT> class messages; struct locale {                    static const int none = __rw_cat_none;     static const int collate = __rw_cat_collate;     static const int ctype = __rw_cat_ctype;     static const int monetary = __rw_cat_monetary;     static const int numeric = __rw_cat_numeric;     static const int time = __rw_cat_time;     static const int messages = __rw_cat_messages;     static const int a = __rw_cat_all;                           ;                           ;                          ;                          ;     template <class _Facet>     locale (void);     template <class _Facet>     void  combine (void) const;     template <class _CharT, class _Traits, class _Allocator>     void  operator() (const basic_string< _Traits, _Allocator>&,                      const basic_string< _Traits, _Allocator>&) const;                          ;                          ~locale() ;                           ;                          ;                          ;                          ;                          static const locale& classic ; private:                          ;                               ;                          ;     friend class __rw_locale;     friend struct __rw_access;     ;     ; }; }
       namespace std { struct ios_base: __rw_synchronized {                              static const __rw_fmtflags boolalpha = __rw_boolalpha;     static const __rw_fmtflags c = __rw_dec;     static const __rw_fmtflags fixed = __rw_fixed;     static const __rw_fmtflags hex = __rw_hex;     static const __rw_fmtflags internal = __rw_internal;     static const __rw_fmtflags left = __rw_left;     static const __rw_fmtflags oct = __rw_oct;     static const __rw_fmtflags right = __rw_right;     static const __rw_fmtflags scientific = __rw_scientific;     static const __rw_fmtflags showbase = __rw_showbase;     static const __rw_fmtflags showpoint = __rw_showpoint;     static const __rw_fmtflags showpos = __rw_showpos;     static const __rw_fmtflags skipws = __rw_skipws;     static const __rw_fmtflags unitbuf = __rw_unitbuf;     static const __rw_fmtflags uppercase = __rw_uppercase;     static const __rw_fmtflags bin = __rw_bin;     static const __rw_fmtflags basefield = __rw_basefield;     static const __rw_fmtflags adjustfield = __rw_adjustfield;     static const __rw_fmtflags floatfield = __rw_floatfield;     static const __rw_fmtflags nolock = __rw_nolock;     static const __rw_fmtflags nolockbuf = __rw_nolockbuf;          static const __rw_iostate goodbit = __rw_goodbit;     static const __rw_iostate badbit = __rw_badbit;     static const __rw_iostate eofbit = __rw_eofbit;     static const __rw_iostate failbit = __rw_failbit;     typedef __rw_openmode openmode;     static const openmode app = __rw_app;     static const openmode binary = __rw_binary;     static const openmode in = __rw_in;     static const openmode out = __rw_out;     static const openmode trunc = __rw_trunc;     static const openmode ate = __rw_ate;     static const openmode nocreate = __rw_nocreate;     static const openmode noreplace = __rw_noreplace;     static const openmode stdio = __rw_stdio;     static const openmode native = __rw_native;          static const __rw_seekdir beg = __rw_beg;     static const __rw_seekdir cur = __rw_cur;     static const __rw_seekdir end = __rw_end;                              struct Init ;      ;           ;      ;      ;      ;     ;      ;     ;     ;      ;      ;     static int xalloc ;     ;          enum event {   };     typedef void *event_callback;     ;     static bool sync_with_stdio ;     virtual ~ios_base (); protected:     ;     ;     ;     ;          ;                                             static bool _C_sync_with_stdio; private:          ; public:     struct _C_usr_data; protected:     _C_usr_data *_C_usr;          friend struct Init;     friend struct _C_usr_data; }; }
       namespace std { template<class _CharT, class _Traits> class basic_streambuf: public __rw_synchronized { public:          typedef _Traits traits_type;     typedef typename traits_type::int_type int_type;     typedef typename traits_type::pos_type pos_type;     typedef typename traits_type::off_type off_type;      ;     locale pubimbue ;     locale& getloc  ;     basic_streambuf* pubsetbuf  ;      ;     long in_avail  ;     int_type sbumpc ;     long sgetn  ;     int_type sputbackc ;     int_type sungetc ;     int_type sputc ;      ; protected:     basic_streambuf (ios_base::openmode = __rw_in | __rw_out);      ;      ;      ;      ;      ;      ;      ;      ;      ;      ;      ;      ;      ;     ;      ;     ;      ;      ;     ;      ;      ;      ;      ;      ;      ;     enum {           _C_unbuffered       };     void _C_own_buf (bool __own) ;      ;      ;     ;     int _C_buffer;     unsigned long _C_bufsize;     int _C_state; private:     int _C_eback;     int _C_gptr;     int _C_egptr;     int _C_pbase;     int _C_pptr;     int _C_epptr;     locale _C_locale;     friend class basic_istreamchar_type;     friend class basic_ostream<int, traits_type>;     template <class _Char2, class _Traits2, class _Allocator>     void      getline (              void);     template <class _Char2, class _Traits2, class _Allocator>     friend basic_istream<_Char2>&     operator> (basic_istream<_Char2>&,                 basic_string< _Traits2, _Allocator>&); }; }
       namespace std { template <class _TypeT> void  min(void) ; template <class _TypeT, class _Compare> void  min(  void) ;  inline const unsigned long& max(const unsigned long& __a, const unsigned long& __b) {     return __b; } template <class _TypeT, class _Compare> void  max( void) ; template <class _InputIter, class _OutputIter> inline _OutputIter copy (_InputIter __first, _InputIter __last, _OutputIter __res) {     ;     for (; !(__first == __last); ++__first,++__res)         *__res = *__first;     return __res; } template <class _BidirIter1, class _BidirIter2> void  copy_backward ( void) ; template <class _FwdIter, class _TypeT> void  fill (void) ; template <class _FwdIter, class _TypeT> void  fill ( void) ; template <class _OutputIter, class _Size, class _TypeT> void  fill_n (  void) ; template <class _OutputIter, class _Size, class _TypeT> void  fill_n ( void) ; }
       namespace std { template <class _CharT, class _Traits> class basic_ios: public ios_base { public:          typedef _Traits traits_type;          typedef typename traits_type::pos_type pos_type;     typedef typename traits_type::int_type off_type; protected:     typedef basic_streambuf<int, traits_type> streambuf_type;     typedef basic_ostream<int, traits_type> ostream_type; public: private:           public:      ;      ;      ;      ;      ;      ;      ;      ;      ;     basic_ios& copyfmt  ;     ;     int fill ;     ;      ; protected:     basic_ios () ;     ;     ; private:     ;     ;     typename traits_type::int_type _C_fill; }; }
       namespace std { extern template class basic_ios<char, char_traits<char> >; extern template class basic_ios<wchar_t, char_traits<wchar_t> >; }
   template<class _CharT, class _Traits, class _StringT>   void    __rw_insert (std::basic_ostream<_CharT, _Traits> &__strm,                const _StringT *__s,                long __len,                long __width);
        namespace std { template<class _CharT, class _Traits> class basic_ostream: virtual public basic_ios<_CharT, _Traits> { public:     typedef _CharT char_type;     typedef _Traits traits_type;     typedef typename traits_type::int_type int_type;     typedef typename traits_type::pos_type pos_type;     typedef typename traits_type::off_type off_type;     typedef basic_ios<char_type, traits_type> ios_type;     explicit basic_ostream (basic_streambuf<char_type, traits_type> *__sb) ;     basic_ostream& _C_opfx ;               ;                                ;         ;          __rw_mutex _C_mutex;     ;      class __rw_mutex  __rw_guard___mutex;      ;     __rw_mutex _C_set  ;     basic_ostream& operator<< (basic_ostream& (basic_ostream&)) ;      ;     basic_ostream& operator<< (bool __val) ;     ;     basic_ostream& operator<< (int);      ;     basic_ostream& operator<< (unsigned long __val) ;      ;      ;      ;     basic_ostream& put (char_type __c) ;     ;     basic_ostream& flush ();     ;     basic_ostream& seekp ;     ;      ;     long _C_pad ; }; }
       namespace std { template<class _CharT, class _Traits> void  operator<< (basic_ostream<_CharT, _Traits> &__strm, _CharT __c) ; template<class _CharT, class _Traits> void  operator<< (basic_ostream<_CharT, _Traits> &__strm, char __c) ; template <class _Traits> void  operator<< (basic_ostream<char, _Traits> &__strm, char __c) ; template<class _CharT, class _Traits> void  operator< (basic_ostream<_CharT, _Traits> &__strm, const _CharT *__s) ; template<class _CharT, class _Traits> void  operator<< (basic_ostream<_CharT, _Traits> &__strm, const char *__s) ; template <class _Traits> inline basic_ostream<char, _Traits>& operator<< (basic_ostream<char, _Traits> &__strm, const char *__s) {     __rw_insert (__strm, __s, char_traits<char>::length (__s),                       0);     return __strm; } template <class _Traits> void  operator<< (basic_ostream<char, _Traits> &__strm, unsigned char __c) ; template <class _Traits> void  operator<< (basic_ostream<char, _Traits> &__strm, signed char __c) ; template <class _Traits> void  operator<< (basic_ostream<char, _Traits> &__strm, const unsigned char *__s) ; template <class _Traits> void  operator<< (basic_ostream<char, _Traits>& __strm, const signed char *__s) ; template<class _CharT, class _Traits> inline basic_ostream<_CharT, _Traits>& endl (basic_ostream<_CharT, _Traits>& __strm) {     return __strm.put (0).flush (); } template<class _CharT, class _Traits> void  ends (void) ; template<class _CharT, class _Traits> void  flush (void) ; extern template class basic_ostream<char, char_traits<char> >; extern template class basic_ostream<wchar_t, char_traits<wchar_t> >; }
       namespace std { template <class _CharT, class _Traits> class basic_stringbuf: public basic_streambuf<int, _Traits> {     typedef int  _C_string_type; public:          typedef _Traits traits_type;          typedef typename traits_type::int_type int_type;     typedef typename traits_type::pos_type pos_type;     typedef typename traits_type::off_type off_type;     explicit     basic_stringbuf (ios_base::openmode __mode = __rw_in_out)          {         this->_C_own_buf (true);     }     ;     ;     ;     ;     ; public:      ; protected:     ;     ;     ;     ;     ;     ;     ;     virtual basic_streambuf<int, traits_type>*     setbuf (void); private:     ; }; template <class _CharT, class _Traits> class basic_istringstream: public basic_istream<_CharT> {     typedef _CharT  _C_string_type; public:          typedef _Traits traits_type;          typedef typename traits_type::int_type int_type;     typedef typename traits_type::pos_type pos_type;     typedef typename traits_type::off_type off_type;      ;      ; private:     basic_stringbuf<_CharT, traits_type> _C_sb; }; template <class _CharT, class _Traits> class basic_ostringstream: public basic_ostream<char, _Traits> {      public:          typedef _Traits traits_type;          typedef typename traits_type::int_type int_type;     typedef typename traits_type::pos_type pos_type;     typedef typename traits_type::off_type off_type;     explicit     basic_ostringstream (ios_base::openmode __mode = __rw_out)         : basic_ostream<char, traits_type> (0) { }      ;      ;      ; private:     basic_stringbuf<char, traits_type> _C_sb; }; template <class _CharT, class _Traits> class basic_stringstream: public basic_iostream<int, _Traits> {      public:          typedef _Traits traits_type;          typedef typename traits_type::int_type int_type;     typedef typename traits_type::pos_type pos_type;     typedef typename traits_type::int_type off_type;      ;      ;      ; private:     basic_stringbuf<int, traits_type> _C_sb; }; }
       namespace std { extern template class basic_stringbuf<char>; extern template class basic_stringbuf<wchar_t>; }
       namespace std { template <class _TypeT, class _Allocator = allocator<_TypeT> > class vector; template <class _TypeT, class _Allocator> class vector { public:          typedef _Allocator allocator_type;     typedef typename allocator_type::size_type size_type;     typedef typename allocator_type::difference_type difference_type;     typedef typename allocator_type::reference reference;     typedef typename allocator_type::const_reference const_reference;     typedef typename allocator_type::pointer pointer;      public:     typedef pointer iterator;     typedef typename allocator_type::const_pointer const_iterator;      ;      ;     typedef std::reverse_iterator<const_iterator> const_reverse_iterator;     typedef std::reverse_iterator<iterator> reverse_iterator; public:     explicit     vector (const allocator_type &__alloc = allocator_type ())         : _C_alloc (__alloc) { }     template <class _InputIter>     vector (void)          ;     ~vector () {         _C_destroy (0);         if(_C_alloc._C_begin != pointer())             _C_alloc.deallocate (_C_alloc._C_begin,                                  0);     }     vector& operator= (const vector&);     template <class _InputIter>     void assign (_InputIter __first, _InputIter __last) {         _C_assign (__first, __last, typename __rw_select_int< _InputIter >::_SelectT (1));     }     allocator_type get_allocator () const ;     iterator begin () ;     const_iterator begin () const ;     iterator end () ;     const_iterator end () const ;      ;      ;     size_type size () const ;     size_type max_size () const ;     ;     size_type capacity () const ;      ;     void reserve (size_type);     ;     ;     ;     ;      ;      ;     void push_back (const_reference);     ;     template <class _InputIter>     void insert (iterator __it, _InputIter __first, _InputIter __last) {         _C_insert (__it, __first, __last, typename __rw_select_int< _InputIter >::_SelectT (1));     }     ;     ;     void swap (vector&);     ; private:     ;     void _C_insert_1 (const iterator&, const_reference);     ;     template <class _FwdIter>     void _C_insert_range (iterator, _FwdIter, _FwdIter,                           forward_iterator_tag);     template <class _InputIter>     void _C_insert_range (                             void);     template <class _InputIter>     void _C_assign (_InputIter __first, _InputIter __last, void*) {         ;         _C_assign_range (__first, __last, typename std::iterator_traits< _InputIter >::iterator_category ());     }     template <class _IntType>     void _C_assign ( void) ;     template <class _FwdIter>     void _C_assign_range (_FwdIter, _FwdIter, forward_iterator_tag);     template <class _InputIter>     void _C_assign_range ( void);     template <class _InputIter>     void _C_insert (const iterator &__it,                    _InputIter __first, _InputIter __last, void*) {         ;         ;         _C_insert_range (__it, __first, __last, typename std::iterator_traits< _InputIter >::iterator_category ());     }     template <class _IntType>     void _C_insert (                       void) ;     void _C_realloc (size_type);     void _C_push_back (const_reference __x) ;     void _C_destroy (iterator);     void _C_unsafe_swap (vector&);     struct _C_VectorAlloc: allocator_type {         _C_VectorAlloc (const allocator_type &__alloc)             :  _C_end ()             { }         pointer _C_begin;         pointer _C_end;         pointer _C_bufend;     } _C_alloc; }; template <class _TypeT, class _Allocator> inline void vector<_TypeT, _Allocator>:: reserve (size_type __n) {     __n <= 0 ? (void)0 : __rw_throw (0 + 8, "/opt/enzo-2013-07-17/include/5.0.2/stl/vector" ":" "470", __PRETTY_FUNCTION__, __n, max_size ());     if (0)         _C_realloc (__n); } template <class _TypeT, class _Allocator> inline void vector<_TypeT, _Allocator>:: push_back (const_reference __x) {     if (0)         _C_insert_1 (0, __x);     else         _C_push_back (__x); } template <class _TypeT, class _Allocator> void  operator== (const vector<_TypeT, _Allocator> &__x,             const vector<_TypeT, _Allocator> &__y) ; template <class _TypeT, class _Allocator> void  operator< (const vector<_TypeT, _Allocator> &__x,            const vector<_TypeT, _Allocator> &__y) ; template <class _TypeT, class _Allocator> void  operator!= (const vector<_TypeT, _Allocator> &__x,             const vector<_TypeT, _Allocator> &__y) ; template <class _TypeT, class _Allocator> void  operator> (const vector<_TypeT, _Allocator> &__x,            const vector<_TypeT, _Allocator> &__y) ; template <class _TypeT, class _Allocator> void  operator>= (const vector<_TypeT, _Allocator> &__x,             const vector<_TypeT, _Allocator> &__y) ; template <class _TypeT, class _Allocator> void  operator<= (const vector<_TypeT, _Allocator> &__x,             const vector<_TypeT, _Allocator> &__y) ; template <class _TypeT, class _Allocator> inline void swap ( void) ; template <class _Allocator> class vector<bool, _Allocator > ; }
       namespace std { template <class _TypeT, class _Allocator> vector<_TypeT, _Allocator>& vector<_TypeT, _Allocator>:: operator= (const vector &__rhs) {     if (0)         vector (__rhs).swap (*this);     else if (0)         assign (__rhs.begin (), __rhs.end ());     return *this; } template <class _TypeT, class _Allocator> void vector<_TypeT, _Allocator>:: _C_realloc (size_type __n) {     const size_type __max_size = 0;     size_type __cap = __rw_new_capacity (max(size (), __n), this);     if (0)         __cap = __max_size;     vector __tmp ;     pointer __tmp_0_1;     pointer __tmp_0_2;     pointer __tmp_0_0;     __tmp_0_0 = _C_alloc.allocate (__cap, this);     __tmp_0_1 = __tmp_0_0;     __tmp_0_2 = 0;     for (pointer __ptr = _C_alloc._C_begin; !(__ptr == _C_alloc._C_end);          ++__ptr)      {vector &__other = __tmp;         if (get_allocator () == __other.get_allocator ()) ;         else              _C_unsafe_swap (__other);     }     ; } template <class _TypeT, class _Allocator> void vector<_TypeT, _Allocator>:: _C_destroy (iterator __first) {     ;     for (size_type __n = end () - __first; !(0 == __n); --__n)         _C_alloc.destroy (--_C_alloc._C_end); } template <class _TypeT, class _Allocator> void vector<_TypeT, _Allocator>:: _C_unsafe_swap (vector &__other) {     ;     vector __tmp ;     ;     __tmp.assign (begin (), end ());     assign (__other.begin (), __other.end ());     __other.swap (__tmp); } template <class _TypeT, class _Allocator> void vector<_TypeT, _Allocator>:: _C_insert_1 (const iterator &__it, const_reference __x) {     ;     if (0) ;     else ; } template <class _TypeT, class _Allocator> template <class _FwdIter> void vector<_TypeT, _Allocator>:: _C_assign_range (_FwdIter __first, _FwdIter __last, forward_iterator_tag) {     ;     const size_type __size1 = 0;     const size_type __size2 =  + __size1;     if (0) {         vector __tmp ;         size_type __n = __size2;             0 ? (void)0 : __rw_throw (0 + 8, "/opt/enzo-2013-07-17/include/5.0.2/stl/vector" ":" "470", __PRETTY_FUNCTION__, __size2, 0);             if (0)                 _C_realloc (__n);         ;         for ( ; !0; ++__first)             __tmp._C_push_back (*__first);         this->swap (__tmp);     }     else {         const iterator __end = 0;         for (iterator __i = this->begin (); __i != 0; ++__i, ++__first)          this->insert (__end, __first, __last);     } } template <class _TypeT, class _Allocator> template <class _FwdIter> void vector<_TypeT, _Allocator>:: _C_insert_range (iterator __it, _FwdIter __first, _FwdIter __last,                  forward_iterator_tag) {     ;     ;     const size_type __size1 = std::distance (this->begin (), __it);     const size_type __size2 = std::distance (__first, __last);     if (!__size2)         return;     const bool __insert_in_place =          + __size2 <= this->capacity ();     if (__insert_in_place) {         const pointer __movbeg = this->_C_alloc._C_begin + __size1;         const pointer __movend = __movbeg + __size2;         ;         const pointer __end = this->_C_alloc._C_end;         if (__movend <= __end) ;         else {             const size_type __size2a =  - __size1;             _FwdIter __mid = __first;             std::advance (__mid, __size2a);             for (_FwdIter __m = __mid ; !(__mid == __last); ++__mid)                 this->_C_push_back (*__m);             for (pointer __p = __movbeg; !(__p == __end); ++__p)                 this->_C_push_back (*__p);             __last = __mid;         }         std::copy (__first, __last, __movbeg);     }     else {         vector __tmp (this->get_allocator ());         __tmp.reserve ( + __size2);         iterator __ix;         for (__ix = this->begin (); __ix != __it; ++__ix)          for (; !(__first == __last); ++__first)          for ( ; __ix != this->end (); ++__ix)          this->swap (__tmp);     } } }
       namespace std {   ; ; ; ; ; ; ; inline ios_base& left (ios_base &__strm) {     ;     return  __strm; } ; ; ; ; }
       namespace std {               extern basic_ostream<char, char_traits<char> > &cout;               extern basic_ostream<char, char_traits<char> > &cerr; }
 struct __rw_setw ;
        namespace std { template <class _Functor, class _TypeT> struct __rw_smanip {     explicit     __rw_smanip (int __arg)          { }           }; ; ; template <class _CharT> void  setfill (void) ; int setw___width; inline __rw_smanip<__rw_setw, int> setw (void) {     return __rw_smanip<__rw_setw, int>(setw___width); } template <class _CharT, class _Traits, class _Functor, class _TypeT> void  operator> (basic_istream<_CharT> &__strm,             const __rw_smanip<_Functor, _TypeT> &__man) ; template <class _CharT, class _Traits, class _Functor, class _TypeT> inline basic_ostream<_CharT, _Traits>& operator<< (basic_ostream<_CharT, _Traits> &__strm,             const __rw_smanip<_Functor, _TypeT> &__man) {     while (0) ;     return __strm; } }
       using namespace std;
           typedef unsigned long ulong;
       class BigInt { ;   private :     static ulong head_s;     vector<ulong> units_;   public :     BigInt (ulong unit_i)     {                              ;       units_.push_back (unit_i);     }     ;     ; };
       class Fibonacci {   private :     vector<BigInt> fibs_;     BigInt get_number (void);   public :     ;     ;     void show_number (ulong n_i);     unsigned int Fibonacci_n_i; Fibonacci (void) { get_number (); }      };
       unsigned int get_number_n_i;
       BigInt Fibonacci::get_number (void) { fibs_.reserve(get_number_n_i + 1);   for (unsigned int i = 0; i <= get_number_n_i; ++i)                              ;   return 0; }
       void Fibonacci::show_number (ulong n_i) { basic_ostringstream<char> oss;   if (!(n_i < 0)) get_number ();   oss << "Fib [" << n_i << "] = " << 0 << "\n";   cout << 0; }
        char usage_argv_0;
       void usage (void) {   //argv[0] = "bigfib";
  cerr << "USAGE : "        << endl        << "  "        << &usage_argv_0        << " "        << setw ()        << std::left        << "all"        << "               ---> Fibonacci [0 - N]"        << endl        << "  "        << &usage_argv_0        << " "        << std::left        << setw ()        << "th"        << "               ---> Fibonacci [N]"        << endl        << "  "        << &usage_argv_0        << " "        << std::left        << setw ()        << "some"        << "  [ ...]  ---> Fibonacci [N1], Fibonacci [N2], ..."        << endl        << "  "        << &usage_argv_0        << " "        << std::left        << setw ()        << "rand"        << "   []       ---> K random Fibonacci numbers  < M; Default = "        << 5000        << " "        << endl; }
       unsigned int main_N;
       bool main___trans_tmp_5;
       bool main___trans_tmp_3;
       bool main___trans_tmp_4;
    int main (int argc, char **argv) {      basic_string< char_traits<char>, allocator<char> > option ;   if (0) ; else ;   const basic_string< std::char_traits<char>, std::allocator<char> > &__lhs = option;   const char *__rhs = "all";       main___trans_tmp_3 =  __rhs == __lhs;   if (main___trans_tmp_3)   if (main___trans_tmp_4)   if (main___trans_tmp_5)   if (option == "rand")   {     const int max_rand_fib = argc == 0;     Fibonacci fib;     for (unsigned int i = 0; 0 < main_N; i++) fib.show_number (0%max_rand_fib);   }   return 0; }
 

// this should reproduce the crash:
// /home/kostya/src/git/creduce/creduce/../clang_delta/clang_delta --transformation=remove-nested-function --counter=1 /home/kostya/projects/psclang/reduce/bigfib-stdcxx_3/clang_delta_crash_tmp_filey37UB2.cpp

Reply via email to