[PATCH] D11793: [compiler-rt] Add SourceLocations for float_cast_overflow data.

Alexey Samsonov via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 10 14:18:27 PDT 2015


samsonov added inline comments.

================
Comment at: lib/ubsan/ubsan_handlers.cc:297
@@ +296,3 @@
+  u8 *FilenameOrTypeDescriptor;
+  internal_memcpy(&FilenameOrTypeDescriptor, Data,
+                  sizeof(FilenameOrTypeDescriptor));
----------------
filcab wrote:
> samsonov wrote:
> > Why not reinterpret_cast<u8*>(Data)?
> It would actually be: `*reinterpret_cast<u8**>(Data)`, which would dereferrence a pointer to `char*` OR a pointer to `TypeDescriptor`, which AFAICT, would technically be UB in one of those cases, due to dereferencing a pointer to `A` as a pointer to `B` (where `A` is `TypeDescriptor`, and `B` is a `char *`). (the first version of the patch had this, and this shouldn't be a problem, but still... technically UB as far as I can tell).
I see, thanks for the explanation!


http://reviews.llvm.org/D11793





More information about the llvm-commits mailing list