Bugzilla – Bug 2542
dead assignment on wifi mac-low
Last modified: 2016-11-07 17:12:19 UTC
Created attachment 2660 [details] patch Very simple case, but please check if the variable (that now is read inside the NS_LOG_DEBUG statement) should be used somewhere else. Without the log statement, the variable value is ignored.
Natale, this will provide the same output right? But I guess this is better as you propose.
But I am a bit confused by the title of this bug though ...
In fact a dead assignment triggered the error on the static analyzer, but I have corrected it by using that value, rather than removing the useless assignment. Just before the log statement, the variable currentSequenceNumber has been assigned the value peek'd from the header, but then in the log statement is peek'd again the value from the header. currentSequenceNumber, later in the code, is overwritten with another value; this lead to the dead assignment error. The patch uses the variable in the log statement instead of peeking again the value. Note that I'm not sure if the value currentSequenceNumber should be used somewhere else, or it was assigned just for logging purpose.
OK to push
changeset 12394:b41f53199fc5