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

Side by Side Diff: runtime/vm/dart_api_message.cc

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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | runtime/vm/raw_object_snapshot.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #include "vm/bigint_operations.h" 5 #include "vm/bigint_operations.h"
6 #include "vm/dart_api_message.h" 6 #include "vm/dart_api_message.h"
7 #include "vm/object.h" 7 #include "vm/object.h"
8 #include "vm/snapshot_ids.h" 8 #include "vm/snapshot_ids.h"
9 #include "vm/symbols.h" 9 #include "vm/symbols.h"
10 #include "vm/unicode.h" 10 #include "vm/unicode.h"
(...skipping 1136 matching lines...) Expand 10 before | Expand all | Expand 10 after
1147 if (length < 0 || 1147 if (length < 0 ||
1148 length > ExternalTypedData::MaxElements( 1148 length > ExternalTypedData::MaxElements(
1149 kExternalTypedDataUint8ArrayCid)) { 1149 kExternalTypedDataUint8ArrayCid)) {
1150 return false; 1150 return false;
1151 } 1151 }
1152 uint8_t* data = object->value.as_external_typed_data.data; 1152 uint8_t* data = object->value.as_external_typed_data.data;
1153 void* peer = object->value.as_external_typed_data.peer; 1153 void* peer = object->value.as_external_typed_data.peer;
1154 Dart_WeakPersistentHandleFinalizer callback = 1154 Dart_WeakPersistentHandleFinalizer callback =
1155 object->value.as_external_typed_data.callback; 1155 object->value.as_external_typed_data.callback;
1156 WriteSmi(length); 1156 WriteSmi(length);
1157 WriteIntptrValue(reinterpret_cast<intptr_t>(data)); 1157 WriteRawPointerValue(reinterpret_cast<intptr_t>(data));
1158 WriteIntptrValue(reinterpret_cast<intptr_t>(peer)); 1158 WriteRawPointerValue(reinterpret_cast<intptr_t>(peer));
1159 WriteIntptrValue(reinterpret_cast<intptr_t>(callback)); 1159 WriteRawPointerValue(reinterpret_cast<intptr_t>(callback));
1160 break; 1160 break;
1161 } 1161 }
1162 default: 1162 default:
1163 UNREACHABLE(); 1163 UNREACHABLE();
1164 } 1164 }
1165 1165
1166 return true; 1166 return true;
1167 } 1167 }
1168 1168
1169 1169
(...skipping 11 matching lines...) Expand all
1181 if (!success) { 1181 if (!success) {
1182 UnmarkAllCObjects(object); 1182 UnmarkAllCObjects(object);
1183 return false; 1183 return false;
1184 } 1184 }
1185 } 1185 }
1186 UnmarkAllCObjects(object); 1186 UnmarkAllCObjects(object);
1187 return true; 1187 return true;
1188 } 1188 }
1189 1189
1190 } // namespace dart 1190 } // namespace dart
OLDNEW
« no previous file with comments | « no previous file | runtime/vm/raw_object_snapshot.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698