summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Morrow <acm@10gen.com>2013-10-16 11:34:16 -0400
committerAndrew Morrow <acm@10gen.com>2013-12-02 10:15:00 -0500
commit77dc6ecf84ef6020ae195e142780369b05533cdf (patch)
treebd7f3d908872a02eedff29b608f00d1b6283140e
parent45662915c2f4e7e19b8333dc93d0d2526d8a34c5 (diff)
downloadmongo-77dc6ecf84ef6020ae195e142780369b05533cdf.tar.gz
SERVER-11099 Partial cherry-pick from upstream v8 to fix UB related mongo shell crash
This is a backport of the portion of https://github.com/v8/v8/commit/b3775cf3 relevant to our vendored version of v8. Please see that commit for more details on the nature of the undefined behavior and how this change fixes it. This will repair the issue with the mongo shell crashing on shutdown when compiled with clang-3.3 or newer. (cherry picked from commit 670c981819ed1512b9f623d3879901dda606ed20)
-rw-r--r--src/third_party/v8/src/spaces.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/third_party/v8/src/spaces.h b/src/third_party/v8/src/spaces.h
index 6602c899dfb..d7a79c6f983 100644
--- a/src/third_party/v8/src/spaces.h
+++ b/src/third_party/v8/src/spaces.h
@@ -321,7 +321,8 @@ class MemoryChunk {
Space* owner() const {
if ((reinterpret_cast<intptr_t>(owner_) & kFailureTagMask) ==
kFailureTag) {
- return reinterpret_cast<Space*>(owner_ - kFailureTag);
+ return reinterpret_cast<Space*>(reinterpret_cast<intptr_t>(owner_) -
+ kFailureTag);
} else {
return NULL;
}