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

Unified Diff: runtime/vm/metrics_test.cc

Issue 1263323003: Fix use-after-free from my previous CL. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 4 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/metrics_test.cc
diff --git a/runtime/vm/metrics_test.cc b/runtime/vm/metrics_test.cc
index b4fe97f615527d3a296c8e3e32a8ae3846c75924..90827392ca5597d3c2f7ac944e1b2aef8f8ed851 100644
--- a/runtime/vm/metrics_test.cc
+++ b/runtime/vm/metrics_test.cc
@@ -16,15 +16,17 @@ namespace dart {
UNIT_TEST_CASE(Metric_Simple) {
Dart_CreateIsolate(
NULL, NULL, bin::isolate_snapshot_buffer, NULL, NULL, NULL);
- Metric metric;
+ {
+ Metric metric;
- // Initialize metric.
- metric.Init(Isolate::Current(), "a.b.c", "foobar", Metric::kCounter);
- EXPECT_EQ(0, metric.value());
- metric.increment();
- EXPECT_EQ(1, metric.value());
- metric.set_value(44);
- EXPECT_EQ(44, metric.value());
+ // Initialize metric.
+ metric.Init(Isolate::Current(), "a.b.c", "foobar", Metric::kCounter);
+ EXPECT_EQ(0, metric.value());
+ metric.increment();
+ EXPECT_EQ(1, metric.value());
+ metric.set_value(44);
+ EXPECT_EQ(44, metric.value());
+ }
Dart_ShutdownIsolate();
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698