diff options
author | Anna Henningsen <anna@addaleax.net> | 2019-06-04 17:26:26 +0200 |
---|---|---|
committer | Daniel Bevenius <daniel.bevenius@gmail.com> | 2019-06-07 05:20:40 +0200 |
commit | b31bfaddebf7f4bb900665f85eb07af4e74ee3a5 (patch) | |
tree | de1ebd7798f732da3d6f602d6668fc837178f566 /test/addons | |
parent | 65a5f7b65f7662715ccc0eb9a835b2dec3d73ce5 (diff) | |
download | android-node-v8-b31bfaddebf7f4bb900665f85eb07af4e74ee3a5.tar.gz android-node-v8-b31bfaddebf7f4bb900665f85eb07af4e74ee3a5.tar.bz2 android-node-v8-b31bfaddebf7f4bb900665f85eb07af4e74ee3a5.zip |
test: make sure vtable is generated in addon test with LTO
PR-URL: https://github.com/nodejs/node/pull/28057
Fixes: https://github.com/nodejs/node/issues/28026
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Diffstat (limited to 'test/addons')
-rw-r--r-- | test/addons/uv-handle-leak/binding.cc | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/test/addons/uv-handle-leak/binding.cc b/test/addons/uv-handle-leak/binding.cc index 221a128432..1b769b141c 100644 --- a/test/addons/uv-handle-leak/binding.cc +++ b/test/addons/uv-handle-leak/binding.cc @@ -15,9 +15,16 @@ void CloseCallback(uv_handle_t* handle) {} class ExampleOwnerClass { public: - virtual ~ExampleOwnerClass() {} + virtual ~ExampleOwnerClass(); }; +// Do not inline this into the class, because that may remove the virtual +// table when LTO is used, and with it the symbol for which we grep the process +// output in test/abort/test-addon-uv-handle-leak. +// When the destructor is not inlined, the compiler will have to assume that it, +// and the vtable, is part of what this compilation unit exports, and keep them. +ExampleOwnerClass::~ExampleOwnerClass() {} + ExampleOwnerClass example_instance; void LeakHandle(const FunctionCallbackInfo<Value>& args) { |