Fix ReturnValue::Set. (issue 15848010)

3 views
Skip to first unread message

ma...@chromium.org

unread,
Jun 6, 2013, 11:07:39 AM6/6/13
to dca...@chromium.org, sven...@chromium.org, v8-...@googlegroups.com
Reviewers: dcarney, Sven Panne,

Message:
dcarney@, ptal. I was under the impression that v8 is already
post-handlepocalyptic, but doesn't seem so. Maybe this was missed because
the
code is inside a template which was not instantiated by tests?

Description:
Fix ReturnValue::Set.

It was using Persistent::operator* which will be removed.

BUG=

Please review this at https://codereview.chromium.org/15848010/

SVN Base: https://v8.googlecode.com/svn/branches/bleeding_edge

Affected files:
M include/v8.h


Index: include/v8.h
diff --git a/include/v8.h b/include/v8.h
index
5526705c84269523ab7eafd144ab26dd12aa594e..0c5e63e5691e828311e88cc37459aea16b3dad08
100644
--- a/include/v8.h
+++ b/include/v8.h
@@ -5641,7 +5641,9 @@ void ReturnValue<T>::Set(const Persistent<S>& handle)
{
if (V8_UNLIKELY(handle.IsEmpty())) {
SetUndefined();
} else {
- *value_ = *reinterpret_cast<internal::Object**>(*handle);
+ const Handle<S>* handlePointer =
+ reinterpret_cast<const Handle<S>*>(&handle);
+ *value_ = *reinterpret_cast<internal::Object**>(**handlePointer);
}
}



dca...@chromium.org

unread,
Jun 6, 2013, 2:09:59 PM6/6/13
to ma...@chromium.org, sven...@chromium.org, v8-...@googlegroups.com
On 2013/06/06 15:07:39, marja wrote:
> dcarney@, ptal. I was under the impression that v8 is already
> post-handlepocalyptic, but doesn't seem so. Maybe this was missed because
> the
> code is inside a template which was not instantiated by tests?

just use the handle value directly - returnvalue should be a friend class of
persistent

https://codereview.chromium.org/15848010/

ma...@chromium.org

unread,
Jun 7, 2013, 5:58:41 AM6/7/13
to dca...@chromium.org, sven...@chromium.org, v8-...@googlegroups.com
alright, made it a friend instead

https://codereview.chromium.org/15848010/

dca...@chromium.org

unread,
Jun 7, 2013, 6:39:45 AM6/7/13
to ma...@chromium.org, sven...@chromium.org, v8-...@googlegroups.com

ma...@chromium.org

unread,
Jun 7, 2013, 6:41:22 AM6/7/13
to dca...@chromium.org, sven...@chromium.org, v8-...@googlegroups.com

sven...@chromium.org

unread,
Jun 7, 2013, 6:42:54 AM6/7/13
to ma...@chromium.org, dca...@chromium.org, v8-...@googlegroups.com

dca...@chromium.org

unread,
Jun 7, 2013, 6:46:58 AM6/7/13
to ma...@chromium.org, sven...@chromium.org, v8-...@googlegroups.com
Committed patchset #2 manually as r14999 (presubmit successful).

https://codereview.chromium.org/15848010/
Reply all
Reply to author
Forward
0 new messages