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

Unified Diff: src/heap.h

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 | « no previous file | src/hydrogen.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/heap.h
diff --git a/src/heap.h b/src/heap.h
index 068c44e713f5569515606e2b582caee994ea17f1..d8d37970daa513c3d312a6d1961f19752e571da8 100644
--- a/src/heap.h
+++ b/src/heap.h
@@ -1293,7 +1293,13 @@ class Heap {
Object** roots_array_start() { return roots_; }
Address* store_buffer_top_address() {
- return reinterpret_cast<Address*>(&roots_[kStoreBufferTopRootIndex]);
+ // Avoid type-punning compiler warnings.
+ union {
+ Object** in;
+ Address* out;
+ } u;
+ u.in = &roots_[kStoreBufferTopRootIndex];
+ return u.out;
}
// Get address of native contexts list for serialization support.
« no previous file with comments | « no previous file | src/hydrogen.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698