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

Unified Diff: src/spaces.h

Issue 12090072: Work around a bug in Clang that optimizes away a NULL check (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 11 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 | « no previous file | src/spaces.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/spaces.h
diff --git a/src/spaces.h b/src/spaces.h
index 25f907ebd8a1653247d564bf49a2aa0fb29420ad..9cab8beef26ae9411ca5da87f7c6d320fd7c738f 100644
--- a/src/spaces.h
+++ b/src/spaces.h
@@ -333,6 +333,14 @@ class MemoryChunk {
kFailureTag);
}
+ // Workaround for a bug in Clang-3.3 which in some situations optimizes away
+ // an "if (chunk->owner() != NULL)" check.
+ bool has_owner() {
+ if (owner_ == 0) return false;
+ if (reinterpret_cast<intptr_t>(owner_) == kFailureTag) return false;
+ return true;
+ }
+
VirtualMemory* reserved_memory() {
return &reservation_;
}
« no previous file with comments | « no previous file | src/spaces.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698