WebKit Bugzilla
Attachment 345837 Details for
Bug 186798
: [JSC] Coverity scan issues
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-186798-20180726132028.patch (text/plain), 12.52 KB, created by
Tomas Popela
on 2018-07-26 04:20:29 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Tomas Popela
Created:
2018-07-26 04:20:29 PDT
Size:
12.52 KB
patch
obsolete
>Subversion Revision: 234252 >diff --git a/Source/JavaScriptCore/ChangeLog b/Source/JavaScriptCore/ChangeLog >index 4a269a00233291197675c3eb36ba25f329704237..643aa66784b584c45b557c7a7b5ab84d4a88e4bb 100644 >--- a/Source/JavaScriptCore/ChangeLog >+++ b/Source/JavaScriptCore/ChangeLog >@@ -1,3 +1,28 @@ >+2018-07-26 Tomas Popela <tpopela@redhat.com> >+ >+ [JSC] Coverity scan issues >+ https://bugs.webkit.org/show_bug.cgi?id=186798 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Initialize the variables. >+ >+ * b3/air/AirAllocateRegistersByGraphColoring.cpp: >+ * bytecode/PolymorphicAccess.h: >+ * dfg/DFGOSRExit.h: >+ * parser/ParserTokens.h: >+ * runtime/ConfigFile.cpp: >+ * runtime/JSBigInt.h: >+ * runtime/PropertySlot.h: >+ * wasm/WasmB3IRGenerator.cpp: >+ * wasm/WasmFormat.h: >+ * wasm/WasmFunctionParser.h: >+ * wasm/WasmTierUpCount.h: >+ * wasm/WasmValidate.cpp: >+ * wasm/js/WasmToJS.cpp: >+ (JSC::Wasm::wasmToJS): >+ * yarr/YarrJIT.h: >+ > 2018-07-26 Fujii Hironori <Hironori.Fujii@sony.com> > > REGRESSION(r234248) [Win] testapi.c: nonstandard extension used: non-constant aggregate initializer >diff --git a/Source/JavaScriptCore/b3/air/AirAllocateRegistersByGraphColoring.cpp b/Source/JavaScriptCore/b3/air/AirAllocateRegistersByGraphColoring.cpp >index 26acffc77926a65e6ecccf786ed6e1206818555d..47e9dfdb6df2b40c13cb4d0a1b6171037591f4af 100644 >--- a/Source/JavaScriptCore/b3/air/AirAllocateRegistersByGraphColoring.cpp >+++ b/Source/JavaScriptCore/b3/air/AirAllocateRegistersByGraphColoring.cpp >@@ -876,7 +876,7 @@ protected: > } > > private: >- unsigned m_positionInMoveList; >+ unsigned m_positionInMoveList { 0 }; > Vector<unsigned, 0, UnsafeVectorOverflow> m_moveList; > Vector<unsigned, 0, UnsafeVectorOverflow> m_lowPriorityMoveList; > }; >diff --git a/Source/JavaScriptCore/bytecode/PolymorphicAccess.h b/Source/JavaScriptCore/bytecode/PolymorphicAccess.h >index 30558551cbcab019f458f739d569ceee1c0462ae..5e72eaa8dbe5f1dea53aa81a743f587526f25be3 100644 >--- a/Source/JavaScriptCore/bytecode/PolymorphicAccess.h >+++ b/Source/JavaScriptCore/bytecode/PolymorphicAccess.h >@@ -122,7 +122,7 @@ public: > } > > private: >- Kind m_kind; >+ Kind m_kind { MadeNoChanges }; > MacroAssemblerCodePtr<JITStubRoutinePtrTag> m_code; > Vector<std::pair<InlineWatchpointSet&, StringFireDetail>> m_watchpointsToFire; > }; >diff --git a/Source/JavaScriptCore/dfg/DFGOSRExit.h b/Source/JavaScriptCore/dfg/DFGOSRExit.h >index 4554975913a88b5e2c702332ce70df64c4ba883d..4c1a2c8ed871a731b87cacf383c3f251765c05ef 100644 >--- a/Source/JavaScriptCore/dfg/DFGOSRExit.h >+++ b/Source/JavaScriptCore/dfg/DFGOSRExit.h >@@ -131,7 +131,7 @@ struct OSRExitState : RefCounted<OSRExitState> { > void* jumpTarget; > ArrayProfile* arrayProfile; > >- ExtraInitializationLevel extraInitializationLevel; >+ ExtraInitializationLevel extraInitializationLevel { }; > Profiler::OSRExit* profilerExit { nullptr }; > }; > >diff --git a/Source/JavaScriptCore/parser/ParserTokens.h b/Source/JavaScriptCore/parser/ParserTokens.h >index 86926036b3e3d08d6180100b9f54417913136ef6..6576f3d3f60473d13417596d03e05eaa1ae1594e 100644 >--- a/Source/JavaScriptCore/parser/ParserTokens.h >+++ b/Source/JavaScriptCore/parser/ParserTokens.h >@@ -263,9 +263,9 @@ struct JSTokenLocation { > struct JSToken { > JSTokenType m_type { ERRORTOK }; > JSTokenData m_data { { nullptr, nullptr, false } }; >- JSTokenLocation m_location; >- JSTextPosition m_startPosition; >- JSTextPosition m_endPosition; >+ JSTokenLocation m_location { }; >+ JSTextPosition m_startPosition { }; >+ JSTextPosition m_endPosition { }; > }; > > ALWAYS_INLINE bool isUpdateOp(JSTokenType token) >diff --git a/Source/JavaScriptCore/runtime/ConfigFile.cpp b/Source/JavaScriptCore/runtime/ConfigFile.cpp >index 98c196f82f6851bdf70ef8d6223b5a169129362f..7f4fbe0317f40e11db8364690f2a80744aa491a2 100644 >--- a/Source/JavaScriptCore/runtime/ConfigFile.cpp >+++ b/Source/JavaScriptCore/runtime/ConfigFile.cpp >@@ -233,7 +233,7 @@ private: > > const char* m_filename; > unsigned m_lineNumber; >- FILE* m_file; >+ FILE* m_file { nullptr }; > char m_buffer[BUFSIZ]; > char* m_srcPtr; > char* m_bufferEnd; >diff --git a/Source/JavaScriptCore/runtime/JSBigInt.h b/Source/JavaScriptCore/runtime/JSBigInt.h >index 5b7db740fe6773dd5ed6c607cb379e07675b9db5..4f3158347a87fe6a30072f25910a69ba5ba2b146 100644 >--- a/Source/JavaScriptCore/runtime/JSBigInt.h >+++ b/Source/JavaScriptCore/runtime/JSBigInt.h >@@ -81,7 +81,7 @@ public: > > std::optional<uint8_t> singleDigitValueForString(); > String toString(ExecState*, unsigned radix); >- >+ > enum class ComparisonMode { > LessThan, > LessThanOrEqual >@@ -93,7 +93,7 @@ public: > GreaterThan, > LessThan > }; >- >+ > JS_EXPORT_PRIVATE static bool equals(JSBigInt*, JSBigInt*); > bool equalsToNumber(JSValue); > static ComparisonResult compare(JSBigInt* x, JSBigInt* y); >@@ -104,7 +104,7 @@ public: > JSObject* toObject(ExecState*, JSGlobalObject*) const; > > static JSBigInt* multiply(ExecState*, JSBigInt* x, JSBigInt* y); >- >+ > ComparisonResult static compareToDouble(JSBigInt* x, double y); > > static JSBigInt* add(VM&, JSBigInt* x, JSBigInt* y); >@@ -112,7 +112,7 @@ public: > static JSBigInt* divide(ExecState*, JSBigInt* x, JSBigInt* y); > static JSBigInt* remainder(ExecState*, JSBigInt* x, JSBigInt* y); > static JSBigInt* unaryMinus(VM&, JSBigInt* x); >- >+ > private: > > using Digit = uintptr_t; >@@ -121,26 +121,26 @@ private: > static constexpr unsigned halfDigitBits = digitBits / 2; > static constexpr Digit halfDigitMask = (1ull << halfDigitBits) - 1; > static constexpr int maxInt = 0x7FFFFFFF; >- >+ > // The maximum length that the current implementation supports would be > // maxInt / digitBits. However, we use a lower limit for now, because > // raising it later is easier than lowering it. > // Support up to 1 million bits. > static constexpr unsigned maxLength = 1024 * 1024 / (sizeof(void*) * bitsPerByte); >- >+ > static uint64_t calculateMaximumCharactersRequired(unsigned length, unsigned radix, Digit lastDigit, bool sign); >- >+ > static ComparisonResult absoluteCompare(JSBigInt* x, JSBigInt* y); > static void absoluteDivWithDigitDivisor(VM&, JSBigInt* x, Digit divisor, JSBigInt** quotient, Digit& remainder); > static void internalMultiplyAdd(JSBigInt* source, Digit factor, Digit summand, unsigned, JSBigInt* result); > static void multiplyAccumulate(JSBigInt* multiplicand, Digit multiplier, JSBigInt* accumulator, unsigned accumulatorIndex); > static void absoluteDivWithBigIntDivisor(VM&, JSBigInt* dividend, JSBigInt* divisor, JSBigInt** quotient, JSBigInt** remainder); >- >+ > enum class LeftShiftMode { > SameSizeResult, > AlwaysAddOneDigit > }; >- >+ > static JSBigInt* absoluteLeftShiftAlwaysCopy(VM&, JSBigInt* x, unsigned shift, LeftShiftMode); > static bool productGreaterThan(Digit factor1, Digit factor2, Digit high, Digit low); > >@@ -173,16 +173,16 @@ private: > void inplaceMultiplyAdd(Digit multiplier, Digit part); > static JSBigInt* absoluteAdd(VM&, JSBigInt* x, JSBigInt* y, bool resultSign); > static JSBigInt* absoluteSub(VM&, JSBigInt* x, JSBigInt* y, bool resultSign); >- >+ > static size_t allocationSize(unsigned length); > static size_t offsetOfData(); > Digit* dataStorage(); > > Digit digit(unsigned); > void setDigit(unsigned, Digit); >- >- unsigned m_length; >- bool m_sign; >+ >+ unsigned m_length { 0 }; >+ bool m_sign { false }; > }; > > inline JSBigInt* asBigInt(JSValue value) >diff --git a/Source/JavaScriptCore/runtime/PropertySlot.h b/Source/JavaScriptCore/runtime/PropertySlot.h >index 066978de972347a716e847da71752532a29d6485..5101504b7da80f0f178fe7be2ed55ed15804dcb6 100644 >--- a/Source/JavaScriptCore/runtime/PropertySlot.h >+++ b/Source/JavaScriptCore/runtime/PropertySlot.h >@@ -370,7 +370,7 @@ private: > JS_EXPORT_PRIVATE JSValue customGetter(ExecState*, PropertyName) const; > JS_EXPORT_PRIVATE JSValue customAccessorGetter(ExecState*, PropertyName) const; > >- unsigned m_attributes; >+ unsigned m_attributes { 0 }; > union { > EncodedJSValue value; > struct { >diff --git a/Source/JavaScriptCore/wasm/WasmB3IRGenerator.cpp b/Source/JavaScriptCore/wasm/WasmB3IRGenerator.cpp >index 3e7ce60ad74b0020474a86993da76e7180dc6f24..22c62e388b42e5e81507a246198ec375dfcce796 100644 >--- a/Source/JavaScriptCore/wasm/WasmB3IRGenerator.cpp >+++ b/Source/JavaScriptCore/wasm/WasmB3IRGenerator.cpp >@@ -148,10 +148,10 @@ public: > > private: > friend class B3IRGenerator; >- BlockType blockType; >- BasicBlock* continuation; >- BasicBlock* special; >- ResultList result; >+ BlockType blockType { }; >+ BasicBlock* continuation { nullptr }; >+ BasicBlock* special { nullptr }; >+ ResultList result { }; > }; > > typedef Value* ExpressionType; >diff --git a/Source/JavaScriptCore/wasm/WasmFormat.h b/Source/JavaScriptCore/wasm/WasmFormat.h >index 2784e90af3841a02e5873332cff8bb06487e33de..c77fb1cee5925fae3c9ca79a625d861b65c57f4a 100644 >--- a/Source/JavaScriptCore/wasm/WasmFormat.h >+++ b/Source/JavaScriptCore/wasm/WasmFormat.h >@@ -226,7 +226,7 @@ public: > std::optional<uint32_t> maximum() const { return m_maximum; } > > private: >- uint32_t m_initial; >+ uint32_t m_initial { 0 }; > std::optional<uint32_t> m_maximum; > bool m_isImport { false }; > bool m_isValid { false }; >diff --git a/Source/JavaScriptCore/wasm/WasmFunctionParser.h b/Source/JavaScriptCore/wasm/WasmFunctionParser.h >index 8735ce8e6accb38e84c84b7b8e11d53379ab8dbe..a4f33e82fdf7e5268f75487cf9def4fd2f15f033 100644 >--- a/Source/JavaScriptCore/wasm/WasmFunctionParser.h >+++ b/Source/JavaScriptCore/wasm/WasmFunctionParser.h >@@ -87,7 +87,7 @@ private: > const Signature& m_signature; > const ModuleInformation& m_info; > >- OpType m_currentOpcode; >+ OpType m_currentOpcode { }; > size_t m_currentOpcodeStartingOffset { 0 }; > > unsigned m_unreachableBlocks { 0 }; >diff --git a/Source/JavaScriptCore/wasm/WasmTierUpCount.h b/Source/JavaScriptCore/wasm/WasmTierUpCount.h >index a989b367e6defe71041afd77fadb3af040183b05..7368ff8600bb26fb355aa9a05e51c4f0e6ac2b9b 100644 >--- a/Source/JavaScriptCore/wasm/WasmTierUpCount.h >+++ b/Source/JavaScriptCore/wasm/WasmTierUpCount.h >@@ -65,7 +65,7 @@ public: > > private: > uint32_t m_count; >- Atomic<bool> m_tierUpStarted; >+ Atomic<bool> m_tierUpStarted { false }; > }; > > } } // namespace JSC::Wasm >diff --git a/Source/JavaScriptCore/wasm/WasmValidate.cpp b/Source/JavaScriptCore/wasm/WasmValidate.cpp >index ea4a7598fa049544f87684a50e3cfcb913108eaf..118866c749daf34f76ef801eeee600f06b4466a6 100644 >--- a/Source/JavaScriptCore/wasm/WasmValidate.cpp >+++ b/Source/JavaScriptCore/wasm/WasmValidate.cpp >@@ -72,8 +72,8 @@ public: > Type signature() const { return m_signature; } > Type branchTargetSignature() const { return type() == BlockType::Loop ? Void : signature(); } > private: >- BlockType m_blockType; >- Type m_signature; >+ BlockType m_blockType { }; >+ Type m_signature { }; > }; > typedef String ErrorType; > typedef Unexpected<ErrorType> UnexpectedResult; >diff --git a/Source/JavaScriptCore/wasm/js/WasmToJS.cpp b/Source/JavaScriptCore/wasm/js/WasmToJS.cpp >index 1270c79b1c4310cc5fc63029ae83bfb18c5e03c6..c764c214220c9fea9385cfb7b518b7f18a8e3462 100644 >--- a/Source/JavaScriptCore/wasm/js/WasmToJS.cpp >+++ b/Source/JavaScriptCore/wasm/js/WasmToJS.cpp >@@ -264,7 +264,7 @@ Expected<MacroAssemblerCodeRef<WasmEntryPtrTag>, BindingFailure> wasmToJS(VM* vm > JSValue result = call(exec, callee, callType, callData, jsUndefined(), args); > RETURN_IF_EXCEPTION(throwScope, 0); > >- uint64_t realResult; >+ uint64_t realResult = 0; > switch (signature.returnType()) { > case Func: > case Anyfunc: >diff --git a/Source/JavaScriptCore/yarr/YarrJIT.h b/Source/JavaScriptCore/yarr/YarrJIT.h >index 07d39983a7d74ddf0650a1ac9642ae8138a2bde4..e0b5e8a84e64a3ec194af11fd9d4eeaff5ecb1a3 100644 >--- a/Source/JavaScriptCore/yarr/YarrJIT.h >+++ b/Source/JavaScriptCore/yarr/YarrJIT.h >@@ -201,7 +201,7 @@ private: > MacroAssemblerCodeRef<YarrMatchOnly8BitPtrTag> m_matchOnly8; > MacroAssemblerCodeRef<YarrMatchOnly16BitPtrTag> m_matchOnly16; > #if ENABLE(YARR_JIT_ALL_PARENS_EXPRESSIONS) >- bool m_usesPatternContextBuffer; >+ bool m_usesPatternContextBuffer { false }; > #endif > std::optional<JITFailureReason> m_failureReason; > };
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 186798
:
343029
|
343036
|
343040
|
343042
|
345837
|
367411