Closed
Bug 991340
Opened 11 years ago
Closed 11 years ago
CID 1123000: Missing return statement in jit/CodeGenerator.cpp as found by Coverity
Categories
(Core :: JavaScript Engine: JIT, defect)
Core
JavaScript Engine: JIT
Tracking
()
RESOLVED
INVALID
People
(Reporter: gkw, Unassigned)
References
(Blocks 1 open bug)
Details
(Keywords: coverity)
Coverity analysis of source code in js/src has found a Missing return statement issue, that probably happened from Feb to Mar 2014.
________________________________________________________________________________________________________
*** CID 1123000: Missing return statement (MISSING_RETURN)
/js/src/jit/CodeGenerator.cpp: 6587 in js::jit::CodeGenerator::addGetPropertyCache(js::jit::LInstruction *, js::jit::RegisterSet, js::jit::Register, js::PropertyName *, js::jit::TypedOrValueRegister, bool)()
6581 GetPropertyParIC cache(objReg, name, output);
6582 return addCache(ins, allocateCache(cache));
6583 }
6584 default:
6585 MOZ_ASSUME_UNREACHABLE("Bad execution mode");
6586 }
>>> CID 1123000: Missing return statement (MISSING_RETURN)
>>> Arriving at the end of a function without returning a value.
6587 }
6588
6589 bool
6590 CodeGenerator::addSetPropertyCache(LInstruction *ins, RegisterSet liveRegs, Register objReg,
6591 PropertyName *name, ConstantOrRegister value, bool strict,
6592 bool needsTypeBarrier)
Eric, any idea what should be added?
Flags: needinfo?(efaustbmo)
Reporter | ||
Comment 1•11 years ago
|
||
> statement issue, that probably happened from Feb to Mar 2014.
On further thoughts, let's discount this range for now.
Comment 2•11 years ago
|
||
It would appear that Coverity doesn't understand MOZ_ASSUME_UNREACHABLE.
Reporter | ||
Comment 3•11 years ago
|
||
So I guess this should be regarded as INVALID?
Comment 4•11 years ago
|
||
Yes.
Comment 5•11 years ago
|
||
Also, it you might want to see if Coverity has their own version of "assume not reached" that you can plug into MOZ_ASSUME_UNREACHABLE. (This pattern shows up in tons of other places.)
Reporter | ||
Comment 6•11 years ago
|
||
OK, thanks all!
Status: NEW → RESOLVED
Closed: 11 years ago
Flags: needinfo?(efaustbmo)
Resolution: --- → INVALID
Comment 7•11 years ago
|
||
Isn't one problem here that MOZ_ASSUME_UNREACHABLE is a no-op in release builds?
Comment 8•11 years ago
|
||
(In reply to Christian Holler (:decoder) from comment #7)
> Isn't one problem here that MOZ_ASSUME_UNREACHABLE is a no-op in release
> builds?
Correcting myself: Not a no-op but just calling __builtin_unreachable and that won't abort anything.
Reporter | ||
Updated•11 years ago
|
Summary: Missing return statement in jit/CodeGenerator.cpp as found by Coverity → CID 1123000: Missing return statement in jit/CodeGenerator.cpp as found by Coverity
Updated•6 years ago
|
Blocks: coverity-analysis
You need to log in
before you can comment on or make changes to this bug.
Description
•