Bug 1828230 - Fix GCC -Wuninitialized warning for js/public/CallArgs.h r=jseward

Differential Revision: https://phabricator.services.mozilla.com/D175541
This commit is contained in:
Emily McDonough 2023-04-19 19:28:51 +00:00
parent 5379509f30
commit 3e9158b6b7

View File

@ -94,7 +94,7 @@ extern JS_PUBLIC_API void CheckIsValidConstructible(const Value& v);
#endif
class MOZ_STACK_CLASS IncludeUsedRval {
mutable bool usedRval_;
mutable bool usedRval_ = false;
public:
bool usedRval() const { return usedRval_; }
@ -118,8 +118,8 @@ class MOZ_STACK_CLASS CallArgsBase {
"WantUsedRval can only be IncludeUsedRval or NoUsedRval");
protected:
Value* argv_;
unsigned argc_;
Value* argv_ = nullptr;
unsigned argc_ = 0;
bool constructing_ : 1;
// True if the caller does not use the return value.
@ -138,6 +138,8 @@ class MOZ_STACK_CLASS CallArgsBase {
void assertUnusedRval() const {}
#endif
CallArgsBase() : constructing_(false), ignoresReturnValue_(false) {}
public:
// CALLEE ACCESS