Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(30)

Issue 2015143005: Workaround dubious casting between CXFA_Object and void* in FXJSE (Closed)

Created:
4 years, 6 months ago by Tom Sepez
Modified:
4 years, 6 months ago
Reviewers:
Lei Zhang
CC:
pdfium-reviews_googlegroups.com
Base URL:
https://pdfium.googlesource.com/pdfium.git@master
Target Ref:
refs/heads/master
Project:
pdfium
Visibility:
Public.

Description

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 Committed: https://pdfium.googlesource.com/pdfium/+/3a005f22703b9303a306bf34cbd17c3729f763aa

Patch Set 1 : Shuffle code around, no functional changes #

Patch Set 2 : drop file #

Patch Set 3 : Add cheapo typechecking (not functional) #

Patch Set 4 : Revert typecheck, actually fix code. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+59 lines, -61 lines) Patch
M BUILD.gn View 1 chunk +0 lines, -1 line 0 comments Download
M xfa.gyp View 1 chunk +0 lines, -1 line 0 comments Download
M xfa/fxfa/fm2js/xfa_fm2jscontext.cpp View 1 chunk +2 lines, -1 line 0 comments Download
M xfa/fxfa/parser/xfa_object.h View 1 2 3 3 chunks +5 lines, -2 lines 0 comments Download
M xfa/fxjse/class.cpp View 3 1 chunk +0 lines, -1 line 0 comments Download
M xfa/fxjse/context.h View 3 1 chunk +9 lines, -0 lines 0 comments Download
M xfa/fxjse/context.cpp View 3 1 chunk +40 lines, -1 line 0 comments Download
M xfa/fxjse/include/fxjse.h View 1 chunk +2 lines, -2 lines 0 comments Download
D xfa/fxjse/util_inline.h View 1 1 chunk +0 lines, -51 lines 0 comments Download
M xfa/fxjse/value.cpp View 3 1 chunk +1 line, -1 line 0 comments Download

Messages

Total messages: 13 (9 generated)
Tom Sepez
Lei, for review. I wanted to get something in before we all left. I may ...
4 years, 6 months ago (2016-05-28 00:21:42 UTC) #6
Lei Zhang
lgtm
4 years, 6 months ago (2016-05-28 00:44:40 UTC) #10
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/2015143005/60001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/2015143005/60001
4 years, 6 months ago (2016-05-28 00:44:46 UTC) #11
commit-bot: I haz the power
4 years, 6 months ago (2016-05-28 00:45:08 UTC) #13
Message was sent while issue was closed.
Committed patchset #4 (id:60001) as
https://pdfium.googlesource.com/pdfium/+/3a005f22703b9303a306bf34cbd17c3729f7...

Powered by Google App Engine
This is Rietveld 408576698