Bug 196073

Summary: [GLIB] User data not correctly passed to callback of functions and constructors with no parameters
Product: WebKit Reporter: Carlos Garcia Campos <cgarcia>
Component: JavaScriptCoreAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: bugs-noreply, commit-queue, ews-watchlist, keith_miller, mark.lam, mcatanzaro, msaboff, saam, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch none

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>