Bug 196073 - [GLIB] User data not correctly passed to callback of functions and constructors with no parameters
Summary: [GLIB] User data not correctly passed to callback of functions and constructo...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2019-03-21 04:03 PDT by Carlos Garcia Campos
Modified: 2019-03-21 07:41 PDT (History)
9 users (show)

See Also:


Attachments
Patch (8.21 KB, patch)
2019-03-21 04:07 PDT, Carlos Garcia Campos
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Carlos Garcia Campos 2019-03-21 04:03:39 PDT
This is because GClosure always expects a first parameter as instance. In case of functions or constructors with no parameters we insert a fake instance which is just a null pointer that is just ignored by the callback. But if the function/constructor has user data the callback will expect one parameter for the user data. In thta case we can simply swap instance/user data so that the fake instance will be the second argument and user data the first one.
Comment 1 Carlos Garcia Campos 2019-03-21 04:07:07 PDT
Created attachment 365530 [details]
Patch
Comment 2 WebKit Commit Bot 2019-03-21 07:36:18 PDT
Comment on attachment 365530 [details]
Patch

Clearing flags on attachment: 365530

Committed r243289: <https://trac.webkit.org/changeset/243289>
Comment 3 WebKit Commit Bot 2019-03-21 07:36:19 PDT
All reviewed patches have been landed.  Closing bug.
Comment 4 Radar WebKit Bug Importer 2019-03-21 07:41:12 PDT
<rdar://problem/49106784>