Bug 63378

Summary: SOFT_LINK_POINTER_OPTIONAL isn't optional.
Product: WebKit Reporter: Jer Noble <jer.noble>
Component: New BugsAssignee: Jer Noble <jer.noble>
Status: RESOLVED FIXED    
Severity: Normal CC: webkit.review.bot
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch none

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!