-
-
Notifications
You must be signed in to change notification settings - Fork 498
fixes v8 GC access violation for zombie objects #638
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
7c59fab
beb4920
80d6607
41c7a89
253a9e1
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
- Loading branch information
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -3700,6 +3700,7 @@ inline napi_value ObjectWrap<T>::ConstructorCallbackWrapper( | |||||||||||||||
| napi_value wrapper = details::WrapCallback([&] { | ||||||||||||||||
| CallbackInfo callbackInfo(env, info); | ||||||||||||||||
| callbackInfo.zombie = new Zombie(); | ||||||||||||||||
| #ifdef NAPI_CPP_EXCEPTIONS | ||||||||||||||||
| try { | ||||||||||||||||
| instance = new T(callbackInfo); | ||||||||||||||||
| return callbackInfo.This(); | ||||||||||||||||
|
|
@@ -3708,6 +3709,14 @@ inline napi_value ObjectWrap<T>::ConstructorCallbackWrapper( | |||||||||||||||
| callbackInfo.zombie->isZombie = true; | ||||||||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||||||
| throw; | ||||||||||||||||
| } | ||||||||||||||||
| #else | ||||||||||||||||
| instance = new T(callbackInfo); | ||||||||||||||||
| if (callbackInfo.Env().IsExceptionPending()) { | ||||||||||||||||
| callbackInfo.zombie->isZombie = true; | ||||||||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
I guess this part should probably be factored out and a call made to it from above and from here. |
||||||||||||||||
| return nullptr; | ||||||||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
It's OK to fall through to the return below. |
||||||||||||||||
| } | ||||||||||||||||
| return callbackInfo.This(); | ||||||||||||||||
| #endif | ||||||||||||||||
| }); | ||||||||||||||||
|
|
||||||||||||||||
| return wrapper; | ||||||||||||||||
|
|
||||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.