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

Unified Diff: runtime/vm/snapshot.h

Issue 323163002: Adds an assertion to limit snapshot intptr_t size. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 6 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/raw_object_snapshot.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/snapshot.h
===================================================================
--- runtime/vm/snapshot.h (revision 37116)
+++ runtime/vm/snapshot.h (working copy)
@@ -181,6 +181,11 @@
return static_cast<intptr_t>(value);
}
+ intptr_t ReadRawPointerValue() {
+ int64_t value = Read<int64_t>();
+ return static_cast<intptr_t>(value);
+ }
+
void ReadBytes(uint8_t* addr, intptr_t len) {
stream_.ReadBytes(addr, len);
}
@@ -399,9 +404,14 @@
// Writes an intptr_t type value out.
void WriteIntptrValue(intptr_t value) {
+ ASSERT((value >= kMinInt32) && (value <= kMaxInt32));
Write<int64_t>(value);
}
+ void WriteRawPointerValue(intptr_t value) {
+ Write<int64_t>(value);
+ }
+
// Write an object that is serialized as an Id (singleton in object store,
// or an object that was already serialized before).
void WriteIndexedObject(intptr_t object_id) {
« no previous file with comments | « runtime/vm/raw_object_snapshot.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698