Bug 37032 - operator ! operated on wrong target which is an object
Summary: operator ! operated on wrong target which is an object
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore Misc. (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Minor
Assignee: Nobody
Depends on:
Reported: 2010-04-02 11:27 PDT by sw
Modified: 2010-04-22 13:59 PDT (History)
2 users (show)

See Also:


Note You need to log in before you can comment on or make changes to this bug.
Description sw 2010-04-02 11:27:54 PDT
In WebCore/loader/SubresourceLoader.cpp line 84, the following line is there
    else if (!request.httpReferrer())

But since request.httpReferrer returns a String object, the ! operator will interpreted unintentionally, the correct fix shall be:
    else if (request.httpReferrer().isEmpty())
Comment 1 Alexey Proskuryakov 2010-04-02 16:17:11 PDT
Does this affect observable behavior?

Would you be willing to submit a patch, as described in <http://webkit.org/coding/contributing.html>?
Comment 2 sw 2010-04-02 16:23:01 PDT
seems it's not changing observable behavior.  I'll submit a patch soon within 2 weeks since will be off next week.
Comment 3 Alexey Proskuryakov 2010-04-02 16:47:23 PDT
I'm actually not sure if there is anything to fix here. Using operator! with String used to convert to NSString* on Mac, but now we have this:

inline bool operator!(const String& str) { return str.isNull(); }

And it was added precisely to fix referrer sending: <http://trac.webkit.org/changeset/18577>.
Comment 4 sw 2010-04-02 17:08:11 PDT
I see your point, I should have checked it more carefully.  Thanks.  I think I need to go back and verify whether the httpReferer will return an empty or plain NULL string.
Comment 5 sw 2010-04-22 13:59:53 PDT
The current code is working as intended.  No bug here.