Commit 1fca8ba
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: #52426
Reviewed-By: Gabriel Schulhof <gabrielschulhof@gmail.com>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
Reviewed-By: Michael Dawson <midawson@redhat.com>1 parent 4e5ce3a commit 1fca8ba
File tree
2 files changed
+33
-9
lines changed- src
- test/js-native-api/test_object
2 files changed
+33
-9
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
858 | 858 | | |
859 | 859 | | |
860 | 860 | | |
861 | | - | |
| 861 | + | |
862 | 862 | | |
863 | 863 | | |
864 | | - | |
| 864 | + | |
| 865 | + | |
865 | 866 | | |
866 | 867 | | |
867 | 868 | | |
868 | 869 | | |
869 | | - | |
870 | | - | |
871 | | - | |
| 870 | + | |
| 871 | + | |
872 | 872 | | |
873 | 873 | | |
874 | 874 | | |
875 | 875 | | |
876 | 876 | | |
877 | | - | |
| 877 | + | |
| 878 | + | |
878 | 879 | | |
879 | 880 | | |
880 | 881 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
629 | 629 | | |
630 | 630 | | |
631 | 631 | | |
| 632 | + | |
| 633 | + | |
| 634 | + | |
| 635 | + | |
632 | 636 | | |
633 | 637 | | |
634 | 638 | | |
635 | 639 | | |
636 | 640 | | |
637 | | - | |
| 641 | + | |
| 642 | + | |
| 643 | + | |
| 644 | + | |
| 645 | + | |
| 646 | + | |
| 647 | + | |
| 648 | + | |
| 649 | + | |
| 650 | + | |
| 651 | + | |
| 652 | + | |
| 653 | + | |
| 654 | + | |
638 | 655 | | |
639 | 656 | | |
640 | 657 | | |
| |||
655 | 672 | | |
656 | 673 | | |
657 | 674 | | |
| 675 | + | |
| 676 | + | |
| 677 | + | |
| 678 | + | |
658 | 679 | | |
659 | 680 | | |
660 | 681 | | |
661 | 682 | | |
662 | 683 | | |
663 | 684 | | |
664 | 685 | | |
665 | | - | |
666 | | - | |
| 686 | + | |
| 687 | + | |
| 688 | + | |
| 689 | + | |
667 | 690 | | |
668 | 691 | | |
669 | 692 | | |
| |||
0 commit comments