diff options
author | tsepez <tsepez@chromium.org> | 2016-05-27 17:45:00 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-05-27 17:45:00 -0700 |
commit | 3a005f22703b9303a306bf34cbd17c3729f763aa (patch) | |
tree | 9f640eaedbcbdf5b24641f33da1a110241feca82 /xfa/fxjse/include/fxjse.h | |
parent | 2f109ab836682cb465270ed303d27955db97d98f (diff) | |
download | pdfium-3a005f22703b9303a306bf34cbd17c3729f763aa.tar.xz |
Workaround dubious casting between CXFA_Object and void* in FXJSE
This is just a crock to get things working until we fix the
underlying issue.
When there's single-inheritance, it may often work in practice
to C-style (reinterpret) cast a Derived* ptr to void* and then
back to a Base* ptr. One place where this blows up is if
Derived has virtual functions but Base does not, in which case
the world will be offset by the size of a vtable ptr.
Because of the use of void* types in FXJSE, the above was happening
when setting a CXFA_ThisProxy (Derived, virtual) to be a global
object (void*). This would then be cast back to a CFXA_Object
(Base, non-virtual) and chaos is ensured.
Not sure how far back this goes.
Along the way, pick up some tidying which was necessary for
simplicity while tracking this down.
BUG=613607
Review-Url: https://codereview.chromium.org/2015143005
Diffstat (limited to 'xfa/fxjse/include/fxjse.h')
-rw-r--r-- | xfa/fxjse/include/fxjse.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/xfa/fxjse/include/fxjse.h b/xfa/fxjse/include/fxjse.h index d2d0bd9014..e278935657 100644 --- a/xfa/fxjse/include/fxjse.h +++ b/xfa/fxjse/include/fxjse.h @@ -72,8 +72,8 @@ void FXJSE_Runtime_Release(v8::Isolate* pIsolate, bool bOwnedRuntime); CFXJSE_Context* FXJSE_Context_Create( v8::Isolate* pIsolate, - const FXJSE_CLASS_DESCRIPTOR* lpGlobalClass = nullptr, - void* lpGlobalObject = nullptr); + const FXJSE_CLASS_DESCRIPTOR* lpGlobalClass, + void* lpGlobalObject); void FXJSE_Context_Release(CFXJSE_Context* pContext); CFXJSE_Value* FXJSE_Context_GetGlobalObject(CFXJSE_Context* pContext); |