Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2979)

Unified Diff: base/values.cc

Issue 2743363004: Temporarily CHECK use after free in Value (Closed)
Patch Set: Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « base/values.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/values.cc
diff --git a/base/values.cc b/base/values.cc
index 5cc0d693bdd11c12e60f14f8921bec3cd303e4da..25a25fba6e489ce8420954941598dace98da8f38 100644
--- a/base/values.cc
+++ b/base/values.cc
@@ -200,6 +200,7 @@ Value& Value::operator=(Value&& that) {
Value::~Value() {
InternalCleanup();
+ alive_ = false;
}
// static
@@ -589,6 +590,8 @@ void Value::InternalMoveAssignFromSameType(Value&& that) {
}
void Value::InternalCleanup() {
+ CHECK(alive_);
+
switch (type_) {
case Type::NONE:
case Type::BOOLEAN:
« no previous file with comments | « base/values.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698