v8: fix pointer arithmetic undefined behavior

Clang branch release_33 would optimize out a != NULL check because of
some undefined behavior. This is a floating patch as a backport of that
fix.

Committed: http://code.google.com/p/v8/source/detail?r=13570
This commit is contained in:
Trevor Norris committed 2013-06-11 14:39:25 -07:00
1 parent 82b3524bce
commit 5d4ac272c7
1 file changed
+2 -1
+2 -1
View File
@@ -320,7 +320,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;
}