Bug 105129 - [Blackberry] Static code analysis warning fixes
Summary: [Blackberry] Static code analysis warning fixes
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit BlackBerry (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-12-16 10:02 PST by sfa
Modified: 2012-12-17 07:46 PST (History)
6 users (show)

See Also:


Attachments
patch to address Klocwork issues (14.08 KB, patch)
2012-12-16 10:22 PST, sfa
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description sfa 2012-12-16 10:02:22 PST
Klocwork issues: 176,177,532,631,632,956,957,958,960,1365,2267,2268,2269,4016,4017,4018,4019
Comment 1 sfa 2012-12-16 10:04:13 PST
Add Rob, patch to follow (limited to blackberry-specific code).
Comment 2 sfa 2012-12-16 10:22:54 PST
Created attachment 179650 [details]
patch to address Klocwork issues
Comment 3 Rob Buis 2012-12-16 11:03:32 PST
Comment on attachment 179650 [details]
patch to address Klocwork issues

Looks good in general but plugin change needs explaining.
Comment 4 Rob Buis 2012-12-16 12:35:20 PST
(In reply to comment #3)
> (From update of attachment 179650 [details])
> Looks good in general but plugin change needs explaining.

Arg, my inline comment disappeared, sorry :(
My question is, is it not a problem that the temp var gets deleted at end of scope? You are handing it over as a pointer.
Comment 5 sfa 2012-12-17 07:27:05 PST
I considered that possibility but it would be an exceptionally strange interface that the single pointer would have a longer lifetime than the event containing it (in my change the scope of the drawRect is exactly the same as the scope of the event). From my reading of the code, the drawRect is a pointer because it can be an array of rects, not that its lifetime is different than the event. Note that this code will merrily consume 128 bytes of stack space each time through the loop reusing the event struct each time. The new code is simpler and consumes far less stack space for what is essentially the same semantics. To further reinforce the scope of the pointer issue, the alloca allocation would go away after the loop is done since the method returns immediately, it can't have a longer lifetime than the event call.
Comment 6 Rob Buis 2012-12-17 07:40:20 PST
Comment on attachment 179650 [details]
patch to address Klocwork issues

After discussing with Yong and Anthony's explanation, looks good.
Comment 7 WebKit Review Bot 2012-12-17 07:46:47 PST
Comment on attachment 179650 [details]
patch to address Klocwork issues

Clearing flags on attachment: 179650

Committed r137908: <http://trac.webkit.org/changeset/137908>
Comment 8 WebKit Review Bot 2012-12-17 07:46:50 PST
All reviewed patches have been landed.  Closing bug.