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

Unified Diff: src/objects-inl.h

Issue 11475027: Flush out potential leaks of Failure objects (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: added comment 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/objects.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/objects-inl.h
diff --git a/src/objects-inl.h b/src/objects-inl.h
index 451a3725a8b7290b1cd446ad27608a0b8f3192aa..077e782905c4009fb67120084eddd3fd7384bc0e 100644
--- a/src/objects-inl.h
+++ b/src/objects-inl.h
@@ -1064,7 +1064,11 @@ Failure* Failure::Construct(Type type, intptr_t value) {
uintptr_t info =
(static_cast<uintptr_t>(value) << kFailureTypeTagSize) | type;
ASSERT(((info << kFailureTagSize) >> kFailureTagSize) == info);
- return reinterpret_cast<Failure*>((info << kFailureTagSize) | kFailureTag);
+ // Fill the unused bits with a pattern that's easy to recognize in crash
+ // dumps.
+ static const int kFailureMagicPattern = 0x0BAD0000;
+ return reinterpret_cast<Failure*>(
+ (info << kFailureTagSize) | kFailureTag | kFailureMagicPattern);
}
« no previous file with comments | « src/objects.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698