https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77567

--- Comment #7 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
(In reply to Kostya Serebryany from comment #6)
> (In reply to Jakub Jelinek from comment #5)
> > Created attachment 39612 [details]
> > pr77567-2.patch
> > 
> > Slightly larger patch, which attempts to diagnose that, but fails to do so,
> > because asan_allocator.cc only has:
> >   u32 alloc_type        : 2;
> > and we now need 3 bits instead of just 2.
> > Dmitry, is there any possibility to free one bit for this in ChunkHeader?
> 
> There are no bits left. 

:(

> But do we need these new states here? 

The first patch doesn't have them, but then can't catch C++17 violations e.g.
like the one in #c0 above.

> Can't we reuse the from_memalign field? 

I've looked at it and I'm afraid it can't, while likely with the current *NEW*
alloc_type from_memalign will be likely false, because it uses minimum
alignment (though haven't verified), from_memalign is used to say if any
padding had to be inserted in between, and that might be sometimes true and
sometimes false for the overaligned allocs, depending on the exact alignment
etc.

> Also, please remember that we can not accept patches from this buganizer --
> they need to go via http://llvm.org/docs/Phabricator.html

I know, I wanted to discuss it here first.  I guess I'll just submit the first
patch and let you deal with the rest later.

Reply via email to