Temporarily CHECK use after free in Value
One of the hypotheses for https://crbug.com/697817 is that a Value is used
after free (see #5 there). To verify/refute that hypothesis, this CL
temporarily introduces and CHECKS an |alive_| flag. This change will be
reverted after a couple of days in Canary, and only serves investigation
purposes.
BUG=697817
Review-Url: https://codereview.chromium.org/2743363004
Cr-Commit-Position: refs/heads/master@{#456801}
CrOS-Libchrome-Original-Commit: e2477101857d4c38dd2eb7fb67312b7fd0022f5e
diff --git a/base/values.cc b/base/values.cc
index 5cc0d69..25a25fb 100644
--- a/base/values.cc
+++ b/base/values.cc
@@ -200,6 +200,7 @@
Value::~Value() {
InternalCleanup();
+ alive_ = false;
}
// static
@@ -589,6 +590,8 @@
}
void Value::InternalCleanup() {
+ CHECK(alive_);
+
switch (type_) {
case Type::NONE:
case Type::BOOLEAN: