Bug 167844

Summary: Static Analyzer: Value stored to 'prev' is never read
Product: WebKit Reporter: Joseph Pecoraro <joepeck>
Component: JavaScriptCoreAssignee: Joseph Pecoraro <joepeck>
Status: RESOLVED FIXED    
Severity: Normal CC: commit-queue, keith_miller, mark.lam, msaboff, saam, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: All   
OS: All   
Attachments:
Description Flags
[PATCH] Proposed Fix none

Joseph Pecoraro
Reported 2017-02-04 16:38:30 PST
Seeing this static analyzer warning all over JavaScriptCore: Source/JavaScriptCore/runtime/JSMapIterator.h:60:13: warning: Value stored to 'prev' is never read prev = bucket; ^ ~~~~~~ Source/JavaScriptCore/runtime/JSSetIterator.h:60:13: warning: Value stored to 'prev' is never read prev = bucket; ^ ~~~~~~ 2 warnings generated.
Attachments
[PATCH] Proposed Fix (2.40 KB, patch)
2017-02-04 16:39 PST, Joseph Pecoraro
no flags
Joseph Pecoraro
Comment 1 2017-02-04 16:39:17 PST
Created attachment 300646 [details] [PATCH] Proposed Fix
Saam Barati
Comment 2 2017-02-04 16:47:39 PST
Comment on attachment 300646 [details] [PATCH] Proposed Fix View in context: https://bugs.webkit.org/attachment.cgi?id=300646&action=review r=me > Source/JavaScriptCore/runtime/JSMapIterator.h:59 > + while (bucket && bucket->deleted()) Oh wow. Can you add a test that would cause this to infinite loop? I don't think it'd be hard. Perhaps something like this: - add three entries to a map - get an iterator to give result of the first entry - delete all entries - call next
Radar WebKit Bug Importer
Comment 3 2017-02-04 16:48:21 PST
Saam Barati
Comment 4 2017-02-04 17:02:46 PST
Comment on attachment 300646 [details] [PATCH] Proposed Fix Ignore my previous comment, I misread the diff, thinking that bucket = bucket->next() was only just now added.
WebKit Commit Bot
Comment 5 2017-02-04 17:27:54 PST
Comment on attachment 300646 [details] [PATCH] Proposed Fix Clearing flags on attachment: 300646 Committed r211675: <http://trac.webkit.org/changeset/211675>
WebKit Commit Bot
Comment 6 2017-02-04 17:27:58 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.