Comment #12 on issue 73 by [email protected]: Detect Use after destruction (but before free)
http://code.google.com/p/address-sanitizer/issues/detail?id=73

IMO c#2 is valid C++.  I think a more elaborate case would look like:

struct A {
  A() : a(42) {}
  ~A() {} // poisons a
  int a;
};
int main() {
  char buffer[sizeof(A)];
  A *a = new (buffer) A();
  a->~A();
// buffer is now free. We should be able to reuse that memory to construct new objects, but it is poisoned, and we can't monitor stores and loads differently in asan.
  a = new (buffer) A(); // BOOM
  a->A();
}

--
You received this message because this project is configured to send all issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings

--
You received this message because you are subscribed to the Google Groups 
"address-sanitizer" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to