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

Unified Diff: runtime/vm/object_test.cc

Issue 396213005: Fix PcDescriptor iteratot to never return a pointer to a memory location since the data can move wi… (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 5 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 | « runtime/vm/object.cc ('k') | runtime/vm/raw_object.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/object_test.cc
===================================================================
--- runtime/vm/object_test.cc (revision 38336)
+++ runtime/vm/object_test.cc (working copy)
@@ -2746,12 +2746,18 @@
// Verify the PcDescriptor entries by accessing them.
const PcDescriptors& pc_descs = PcDescriptors::Handle(code.pc_descriptors());
PcDescriptors::Iterator iter(pc_descs, RawPcDescriptors::kAnyKind);
- const RawPcDescriptors::PcDescriptorRec& rec0 = iter.Next();
- const RawPcDescriptors::PcDescriptorRec& rec1 = iter.Next();
- const RawPcDescriptors::PcDescriptorRec& rec2 = iter.Next();
- const RawPcDescriptors::PcDescriptorRec& rec3 = iter.Next();
- const RawPcDescriptors::PcDescriptorRec& rec4 = iter.Next();
- const RawPcDescriptors::PcDescriptorRec& rec5 = iter.Next();
+ RawPcDescriptors::PcDescriptorRec rec0;
+ RawPcDescriptors::PcDescriptorRec rec1;
+ RawPcDescriptors::PcDescriptorRec rec2;
+ RawPcDescriptors::PcDescriptorRec rec3;
+ RawPcDescriptors::PcDescriptorRec rec4;
+ RawPcDescriptors::PcDescriptorRec rec5;
+ iter.NextRec(&rec0);
+ iter.NextRec(&rec1);
+ iter.NextRec(&rec2);
+ iter.NextRec(&rec3);
+ iter.NextRec(&rec4);
+ iter.NextRec(&rec5);
ASSERT(!iter.HasNext());
EXPECT_EQ(1, rec0.try_index());
@@ -2795,12 +2801,18 @@
// Verify the PcDescriptor entries by accessing them.
const PcDescriptors& pc_descs = PcDescriptors::Handle(code.pc_descriptors());
PcDescriptors::Iterator iter(pc_descs, RawPcDescriptors::kAnyKind);
- const RawPcDescriptors::PcDescriptorRec& rec0 = iter.Next();
- const RawPcDescriptors::PcDescriptorRec& rec1 = iter.Next();
- const RawPcDescriptors::PcDescriptorRec& rec2 = iter.Next();
- const RawPcDescriptors::PcDescriptorRec& rec3 = iter.Next();
- const RawPcDescriptors::PcDescriptorRec& rec4 = iter.Next();
- const RawPcDescriptors::PcDescriptorRec& rec5 = iter.Next();
+ RawPcDescriptors::PcDescriptorRec rec0;
+ RawPcDescriptors::PcDescriptorRec rec1;
+ RawPcDescriptors::PcDescriptorRec rec2;
+ RawPcDescriptors::PcDescriptorRec rec3;
+ RawPcDescriptors::PcDescriptorRec rec4;
+ RawPcDescriptors::PcDescriptorRec rec5;
+ iter.NextRec(&rec0);
+ iter.NextRec(&rec1);
+ iter.NextRec(&rec2);
+ iter.NextRec(&rec3);
+ iter.NextRec(&rec4);
+ iter.NextRec(&rec5);
ASSERT(!iter.HasNext());
EXPECT_EQ(-1, rec0.try_index());
« no previous file with comments | « runtime/vm/object.cc ('k') | runtime/vm/raw_object.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698