Bug 63378 - SOFT_LINK_POINTER_OPTIONAL isn't optional.
Summary: SOFT_LINK_POINTER_OPTIONAL isn't optional.
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Jer Noble
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-06-24 23:15 PDT by Jer Noble
Modified: 2011-06-25 14:36 PDT (History)
1 user (show)

See Also:


Attachments
Patch (1.48 KB, patch)
2011-06-24 23:18 PDT, Jer Noble
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jer Noble 2011-06-24 23:15:01 PDT
SOFT_LINK_POINTER_OPTIONAL isn't optional.
Comment 1 Jer Noble 2011-06-24 23:16:13 PDT
SOFT_LINK_POINTER_OPTIONAL was intended to be optional, but would crash if the requested symbol was not present in the passed in framework, in the same way SOFT_LINK_POINTER would.
Comment 2 Jer Noble 2011-06-24 23:18:10 PDT
Created attachment 98582 [details]
Patch
Comment 3 Maciej Stachowiak 2011-06-25 13:29:19 PDT
Comment on attachment 98582 [details]
Patch

r=me
Comment 4 Darin Adler 2011-06-25 13:30:02 PDT
Comment on attachment 98582 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=98582&action=review

> Source/WebCore/platform/mac/SoftLinking.h:141
> -        pointer##name = static_cast<type>(*pointer); \
> +        if (pointer) \
> +            pointer##name = static_cast<type>(*pointer); \

Looks OK. I guess that pointer##name is a global and so is guaranteed to be initialized to zero.
Comment 5 WebKit Review Bot 2011-06-25 14:20:35 PDT
Comment on attachment 98582 [details]
Patch

Clearing flags on attachment: 98582

Committed r89748: <http://trac.webkit.org/changeset/89748>
Comment 6 WebKit Review Bot 2011-06-25 14:20:39 PDT
All reviewed patches have been landed.  Closing bug.
Comment 7 Jer Noble 2011-06-25 14:36:41 PDT
Comment on attachment 98582 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=98582&action=review

>> Source/WebCore/platform/mac/SoftLinking.h:141
>> +            pointer##name = static_cast<type>(*pointer); \
> 
> Looks OK. I guess that pointer##name is a global and so is guaranteed to be initialized to zero.

Yup, global static. Thanks!