[llvm-commits] [compiler-rt] r170388 - /compiler-rt/trunk/lib/ubsan/lit_tests/TypeCheck/vptr.cpp

Richard Smith richard at metafoo.co.uk
Tue Dec 18 17:39:26 PST 2012


On Tue, Dec 18, 2012 at 2:03 AM, Dmitri Gribenko <gribozavr at gmail.com> wrote:
> On Tue, Dec 18, 2012 at 2:23 AM, Richard Smith
> <richard-llvm at metafoo.co.uk> wrote:
>> Author: rsmith
>> Date: Mon Dec 17 18:23:12 2012
>> New Revision: 170388
>>
>> URL: http://llvm.org/viewvc/llvm-project?rev=170388&view=rev
>> Log:
>> Rein ubsan's vptr sanitizer back a bit. Per core issue 453, binding a reference
>> to an object outside its lifetime does not have undefined behavior.
>
> Hello Richard,
>
> Excuse me if I misunderstand it, but shouldn't the commit message say
> something like "binding a reference to an object of a different type
> is allowed if the underlying storage has suitable size and alignment"?

That's mostly equivalent (there doesn't have to be an object at all,
just storage, so that isn't quite right). I was trying to point out
the thing that changed in the commit (that reference binding where
there isn't an object in its lifetime isn't itself UB) rather than
explaining the new rules -- the size and alignment rules are
irrelevant for this change, and are not related to the vptr sanitizer.



More information about the llvm-commits mailing list