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

Unified Diff: src/serialize.cc

Issue 11590005: Fix -Wstrict-aliasing warnings.
Patch Set: Created 8 years 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 | « src/hydrogen.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/serialize.cc
diff --git a/src/serialize.cc b/src/serialize.cc
index dfc55740a36c412f710570e0a59bd73bb726f429..13c95c659adb840b8812113b554919a4f3808df8 100644
--- a/src/serialize.cc
+++ b/src/serialize.cc
@@ -1154,7 +1154,15 @@ int PartialSerializer::PartialSnapshotCacheIndex(HeapObject* heap_object) {
// and we can refer to it from the partial snapshot.
int length = isolate->serialize_partial_snapshot_cache_length();
isolate->PushToPartialSnapshotCache(heap_object);
- startup_serializer_->VisitPointer(reinterpret_cast<Object**>(&heap_object));
+
+ // Avoid type-punning compiler warnings.
+ union {
+ HeapObject** in;
+ Object** out;
+ } u;
+ u.in = &heap_object;
+ startup_serializer_->VisitPointer(u.out);
+
// We don't recurse from the startup snapshot generator into the partial
// snapshot generator.
ASSERT(length == isolate->serialize_partial_snapshot_cache_length() - 1);
« no previous file with comments | « src/hydrogen.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698