RESOLVED FIXED 105129
[Blackberry] Static code analysis warning fixes
https://bugs.webkit.org/show_bug.cgi?id=105129
Summary [Blackberry] Static code analysis warning fixes
sfa
Reported 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
Attachments
patch to address Klocwork issues (14.08 KB, patch)
2012-12-16 10:22 PST, sfa
no flags
sfa
Comment 1 2012-12-16 10:04:13 PST
Add Rob, patch to follow (limited to blackberry-specific code).
sfa
Comment 2 2012-12-16 10:22:54 PST
Created attachment 179650 [details] patch to address Klocwork issues
Rob Buis
Comment 3 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.
Rob Buis
Comment 4 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.
sfa
Comment 5 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.
Rob Buis
Comment 6 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.
WebKit Review Bot
Comment 7 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>
WebKit Review Bot
Comment 8 2012-12-17 07:46:50 PST
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.