node/test/js-native-api
Niels Martignène c1bbc5d569
node-api: copy external type tags when they are set
In order to adapt to V8 changes regarding storing private
properties on Externals, ExternalWrapper objects were introduced
in #51149.

However, this new code stores the type tag pointer and not the
128-bit value inside. This breaks some pre-existing code that
were making temporary tags. It also means that unloading the module
will cause existing External objects to have a tag pointer that
points nowhere (use-after-free bug).

Change ExternalWrapper to store tags by value to fix this regression.

PR-URL: https://github.com/nodejs/node/pull/52426
Reviewed-By: Gabriel Schulhof <gabrielschulhof@gmail.com>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
Reviewed-By: Michael Dawson <midawson@redhat.com>
2024-04-15 17:18:37 +00:00
..
2_function_arguments test: avoid copying test source files 2023-09-10 06:11:36 +00:00
3_callbacks test: avoid copying test source files 2023-09-10 06:11:36 +00:00
4_object_factory test: avoid copying test source files 2023-09-10 06:11:36 +00:00
5_function_factory test: avoid copying test source files 2023-09-10 06:11:36 +00:00
6_object_wrap test: avoid copying test source files 2023-09-10 06:11:36 +00:00
7_factory_wrap test: avoid copying test source files 2023-09-10 06:11:36 +00:00
8_passing_wrapped test: avoid copying test source files 2023-09-10 06:11:36 +00:00
test_array test: avoid copying test source files 2023-09-10 06:11:36 +00:00
test_bigint test: avoid copying test source files 2023-09-10 06:11:36 +00:00
test_cannot_run_js test: fix unreliable assumption in js-native-api/test_cannot_run_js 2024-03-01 01:44:55 +00:00
test_constructor test: avoid copying test source files 2023-09-10 06:11:36 +00:00
test_conversions test: avoid copying test source files 2023-09-10 06:11:36 +00:00
test_dataview test: avoid copying test source files 2023-09-10 06:11:36 +00:00
test_date test: avoid copying test source files 2023-09-10 06:11:36 +00:00
test_error test: avoid copying test source files 2023-09-10 06:11:36 +00:00
test_exception test: avoid copying test source files 2023-09-10 06:11:36 +00:00
test_finalizer node-api: segregate nogc APIs from rest via type system 2023-12-19 07:37:15 +00:00
test_function test: avoid copying test source files 2023-09-10 06:11:36 +00:00
test_general test: avoid copying test source files 2023-09-10 06:11:36 +00:00
test_handle_scope test: avoid copying test source files 2023-09-10 06:11:36 +00:00
test_instance_data test: avoid copying test source files 2023-09-10 06:11:36 +00:00
test_new_target test: avoid copying test source files 2023-09-10 06:11:36 +00:00
test_number test: avoid copying test source files 2023-09-10 06:11:36 +00:00
test_object node-api: copy external type tags when they are set 2024-04-15 17:18:37 +00:00
test_promise test: avoid copying test source files 2023-09-10 06:11:36 +00:00
test_properties test: avoid copying test source files 2023-09-10 06:11:36 +00:00
test_reference node-api: enable uncaught exceptions policy by default 2023-09-25 04:23:58 +00:00
test_reference_double_free test: avoid copying test source files 2023-09-10 06:11:36 +00:00
test_string node-api: move NAPI_EXPERIMENTAL definition to gyp file 2024-01-10 04:08:27 +00:00
test_symbol test: avoid copying test source files 2023-09-10 06:11:36 +00:00
test_typedarray test: avoid copying test source files 2023-09-10 06:11:36 +00:00
.gitignore Revert "test: ignore the copied entry_point.c" 2023-09-10 06:11:37 +00:00
common-inl.h node-api: return napi_exception_pending on proxy handlers 2023-10-23 18:17:49 -04:00
common.h node-api: segregate nogc APIs from rest via type system 2023-12-19 07:37:15 +00:00
entry_point.h test: avoid copying test source files 2023-09-10 06:11:36 +00:00
testcfg.py