[compiler-rt] r178238 - [Sanitizer] Minor enhancements in InternalVector container

Alexey Samsonov samsonov at google.com
Thu Mar 28 23:47:07 PDT 2013


On Thu, Mar 28, 2013 at 8:38 PM, Alexander Potapenko <glider at google.com>wrote:

> Which configuration enables DCHECKs? Are they enabled on our bots? If
> not, they're almost useless and may rot soon.
>

I understand your concern... DCHECK's are enabled in debug TSan builds
(which run tests from tsan and sanitizer_common).
But we may extend this to all sanitizer_tools to be safer.


>
> On Thu, Mar 28, 2013 at 7:37 PM, Alexey Samsonov <samsonov at google.com>
> wrote:
> > Author: samsonov
> > Date: Thu Mar 28 10:37:11 2013
> > New Revision: 178238
> >
> > URL: http://llvm.org/viewvc/llvm-project?rev=178238&view=rev
> > Log:
> > [Sanitizer] Minor enhancements in InternalVector container
> >
> > Modified:
> >     compiler-rt/trunk/lib/sanitizer_common/sanitizer_common.h
> >
> > Modified: compiler-rt/trunk/lib/sanitizer_common/sanitizer_common.h
> > URL:
> http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/sanitizer_common/sanitizer_common.h?rev=178238&r1=178237&r2=178238&view=diff
> >
> ==============================================================================
> > --- compiler-rt/trunk/lib/sanitizer_common/sanitizer_common.h (original)
> > +++ compiler-rt/trunk/lib/sanitizer_common/sanitizer_common.h Thu Mar 28
> 10:37:11 2013
> > @@ -282,7 +282,11 @@ class InternalVector {
> >      UnmapOrDie(data_, capacity_ * sizeof(T));
> >    }
> >    T &operator[](uptr i) {
> > -    CHECK_LT(i, size_);
> > +    DCHECK_LT(i, size_);
> > +    return data_[i];
> > +  }
> > +  const T &operator[](uptr i) const {
> > +    DCHECK_LT(i, size_);
> >      return data_[i];
> >    }
> >    void push_back(const T &element) {
> > @@ -301,7 +305,7 @@ class InternalVector {
> >      CHECK_GT(size_, 0);
> >      size_--;
> >    }
> > -  uptr size() {
> > +  uptr size() const {
> >      return size_;
> >    }
> >
> >
> >
> > _______________________________________________
> > llvm-commits mailing list
> > llvm-commits at cs.uiuc.edu
> > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>
>
>
> --
> Alexander Potapenko
> Software Engineer
> Google Moscow
>



-- 
Alexey Samsonov, MSK
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20130329/4716afc4/attachment.html>


More information about the llvm-commits mailing list