From 2334e9e583799a8cb2dfefb3c7e15c5a7da8ead0 Mon Sep 17 00:00:00 2001 From: tsepez Date: Thu, 9 Jun 2016 09:32:44 -0700 Subject: Fix crash in CXFA_Node::TryUserData() (speculative) Fix is speculative because I can't repro locally, but I know the current code is wrong. I fixed this intially in https://codereview.chromium.org/2015143005/ I then broke it again in https://codereview.chromium.org/2019333006/ There is another spot where we are still casting through void*, and the CXFA_Node*'s alignment is getting messed up when it fails to adjust for it's vtable. Using CFXJSE_HostObject consistently avoids the issue. Adding a virtual dtor to CFXJSE_HostObject might skirt the issue, but I want to be able to wrap simple objects without that penalty if desired. BUG=616339 Review-Url: https://codereview.chromium.org/2055473004 --- xfa/fxjse/include/fxjse.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'xfa/fxjse/include/fxjse.h') diff --git a/xfa/fxjse/include/fxjse.h b/xfa/fxjse/include/fxjse.h index d7c85f54e8..8f30faac30 100644 --- a/xfa/fxjse/include/fxjse.h +++ b/xfa/fxjse/include/fxjse.h @@ -14,7 +14,11 @@ class CFXJSE_Arguments; class CFXJSE_Value; -class CFXJSE_HostObject {}; // C++ object which can be wrapped by CFXJSE_value. +// C++ object which can be wrapped by CFXJSE_value. +class CFXJSE_HostObject { + public: + virtual ~CFXJSE_HostObject() {} +}; typedef void (*FXJSE_FuncCallback)(CFXJSE_Value* pThis, const CFX_ByteStringC& szFuncName, -- cgit v1.2.3