WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
NEW
143770
GCC warns that JSValue v is used without initialization
https://bugs.webkit.org/show_bug.cgi?id=143770
Summary
GCC warns that JSValue v is used without initialization
LRN
Reported
2015-04-15 06:32:36 PDT
../webkitgtk-2.4.8/Source/JavaScriptCore/runtime/JSObject.cpp: In member function 'JSC::ContiguousJSValues JSC::JSObject::genericConvertDoubleToContiguous(JSC::VM&) [with JSC::JSObject::DoubleToContiguousMode mode = (JSC::JSObject::DoubleToContiguousMode)0u; JSC::ContiguousJSValues = JSC::ContiguousData<JSC::WriteBarrier<JSC::Unknown> >]': ../webkitgtk-2.4.8/Source/JavaScriptCore/runtime/JSObject.cpp:822:17: warning: 'v' is used uninitialized in this function [-Wuninitialized] This shouldn't really happen, as the enumeration only has two values, but gcc doesn't seem to understand it. Probably because it's a template. Also, 'v' is an object, so there's an uninitialized object that participates in a '=' operator, so that could be the cause for concern as well.
Attachments
Silence the warning about JSValue 'v' being uninitialized
(4.39 KB, patch)
2015-04-15 10:12 PDT
,
LRN
ap
: review-
Details
Formatted Diff
Diff
View All
Add attachment
proposed patch, testcase, etc.
LRN
Comment 1
2015-04-15 10:12:22 PDT
Created
attachment 250817
[details]
Silence the warning about JSValue 'v' being uninitialized This shouldn't really happen, as the enumeration only has two values, but gcc doesn't seem to understand it. Probably because it's a template. Also, 'v' is an object, so there's an uninitialized object that participates in a '=' operator, so that could be the cause for concern as well. Fix this by completely separating two cases at the cost of code duplication. Otherwise one would get this: ../webkitgtk-2.4.8/Source/JavaScriptCore/runtime/JSObject.cpp: In member function 'JSC::ContiguousJSValues JSC::JSObject::genericConvertDoubleToContiguous(JSC::VM&) [with JSC::JSObject::DoubleToContiguousMode mode = (JSC::JSObject::DoubleToContiguousMode)0u; JSC::ContiguousJSValues = JSC::ContiguousData<JSC::WriteBarrier<JSC::Unknown> >]': ../webkitgtk-2.4.8/Source/JavaScriptCore/runtime/JSObject.cpp:822:17: warning: 'v' is used uninitialized in this function [-Wuninitialized]
Alexey Proskuryakov
Comment 2
2015-04-15 18:08:53 PDT
Comment on
attachment 250817
[details]
Silence the warning about JSValue 'v' being uninitialized R-, because the patch does not apply to trunk. Also, the change to switch indentation is incorrect per WebKit style.
LRN
Comment 3
2015-04-21 04:07:59 PDT
Maybe this could be fixed by backporting whatever code is in the trunk now? Since this patch does not apply, i'm assuming that the code changed since 2.4.x
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug