diff options
author | Michael Dawson <mdawson@devrus.com> | 2017-06-13 00:40:00 -0400 |
---|---|---|
committer | Michael Dawson <michael_dawson@ca.ibm.com> | 2017-06-21 16:57:39 -0400 |
commit | 3e18c49657bcb0f2504def3d7d6d900f0c25e357 (patch) | |
tree | f169c7d5fb1338fe724fa2c59e5c560cd3125b71 /src/node_api_types.h | |
parent | 9a655e98a499cfa4c7db7664a5b2930a1e97af21 (diff) | |
download | android-node-v8-3e18c49657bcb0f2504def3d7d6d900f0c25e357.tar.gz android-node-v8-3e18c49657bcb0f2504def3d7d6d900f0c25e357.tar.bz2 android-node-v8-3e18c49657bcb0f2504def3d7d6d900f0c25e357.zip |
n-api: avoid crash in napi_escape_scope()
V8 will crash if escape is called twice on the same
scope.
Add checks to avoid crashing if napi_escape_scope() is
called to try and do this.
Add test that tries to call napi_create_scope() twice.
PR-URL: https://github.com/nodejs/node/pull/13651
Reviewed-By: Jason Ginchereau <jasongin@microsoft.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Diffstat (limited to 'src/node_api_types.h')
-rw-r--r-- | src/node_api_types.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/node_api_types.h b/src/node_api_types.h index 4bf1b82631..43102c519c 100644 --- a/src/node_api_types.h +++ b/src/node_api_types.h @@ -67,7 +67,7 @@ typedef enum { napi_generic_failure, napi_pending_exception, napi_cancelled, - napi_status_last + napi_escape_called_twice } napi_status; typedef napi_value (*napi_callback)(napi_env env, |