[Static Analysis][Unchecked return value] In function WebGLContextLossHandler::RunTimer() from WebGLContextLossHandler.cpp

RESOLVED DUPLICATE of bug 1280507

Status

()

Core
Canvas: WebGL
RESOLVED DUPLICATE of bug 1280507
2 years ago
a year ago

People

(Reporter: andi, Assigned: andi)

Tracking

(Blocks: 1 bug, {coverity})

Trunk
coverity
Points:
---

Firefox Tracking Flags

(firefox45 affected)

Details

(Whiteboard: CID 1327929)

Attachments

(1 attachment)

(Assignee)

Description

2 years ago
The Static Analysis tool Coverity added that return value from workerPrivate->AddFeature(workerPrivate->GetJSContext(), this) is not checked.

>>        if (!mFeatureAdded) {
>>            workerPrivate->AddFeature(workerPrivate->GetJSContext(), this);
>>            mFeatureAdded = true;
>>        }

I've added these lines of code:
>>       if(NS_WARN_IF(!workerPrivate->AddFeature(workerPrivate->GetJSContext(), this)))
>>          return;
>>      else    
>>          mFeatureAdded = true;

That when AddFeature fails and it get called dirrectly from TimerCallback we should also be blocked by the assert and to signal a potential issue:

>>    if (mShouldRunTimerAgain) {
>>        RunTimer();
>>        MOZ_ASSERT(mIsTimerRunning);
>>    }

Now i'm not sure that we should have the return in the event AddFeature fails, but i put it there in order to signal that we no longer trigger a StartTimer.
(Assignee)

Comment 1

2 years ago
Created attachment 8697229 [details] [diff] [review]
Bug 1231627.diff
Attachment #8697229 - Flags: review?(jmuizelaar)
Attachment #8697229 - Flags: review?(jmuizelaar) → review?(jgilbert)
Duping this to bug 1280507, since that bug removes this code.
Status: NEW → RESOLVED
Last Resolved: a year ago
Resolution: --- → DUPLICATE
Duplicate of bug: 1280507
Attachment #8697229 - Flags: review?(jgilbert)
You need to log in before you can comment on or make changes to this bug.