eugenis added inline comments.

================
Comment at: include/sanitizer/msan_interface.h:96
@@ +95,3 @@
+  /* Tell MSan about newly destroyed memory. Mark memory as uninitialized. */
+  void __sanitizer_dtor_callback(volatile void* data, size_t size);
+
----------------
nmusgrave wrote:
> eugenis wrote:
> > Make it "const volatile *".
>   - why? I was looking at msan_allocated_memory and saw the const volatile 
> void* parameter, but don't understand why its const. Since the memory is 
> being poisoned, shouldn't it -not- be const?
>   - ...or can the parameter be const since its not the memory at this 
> location, but the shadow memory, that's marked as poisoned?
>   - also: naming conventions. Shouldn't it be __msan_dtor_callback? That 
> seems to align better with the other msan runtime functions here. If so, I'll 
> change the naming in codegen/
> 
> 
This only really matters for functions the would be called from the user code. 
The idea is that even if some memory is "const", we can mark it as 
uninitialized or not.

The name starts with __sanitizer because it may be implemented in other 
sanitizers, too. Maybe in the future. ASan can be taught to detect 
use-after-dtor too, for example, but with some false positives.



http://reviews.llvm.org/D11283




_______________________________________________
cfe-commits mailing list
cfe-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to