Bug 186756

Summary: [GTK] Wrong variable used in RenderThemeGtk
Product: WebKit Reporter: Tomas Popela <tpopela>
Component: WebKitGTKAssignee: Tomas Popela <tpopela>
Status: RESOLVED FIXED    
Severity: Normal CC: bugs-noreply, calvaris, cgarcia, mcatanzaro
Priority: P2    
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch none

Description Tomas Popela 2018-06-18 04:06:22 PDT
Found by Coverity scan:

1. webkitgtk-2.20.3/Source/WebCore/rendering/RenderThemeGtk.cpp:1304: cond_const: Condition "part != WebCore::SliderThumbHorizontalPart", taking false branch. Now the value of "part" is equal to 44.
2. webkitgtk-2.20.3/Source/WebCore/rendering/RenderThemeGtk.cpp:1304: cond_const: Condition "part != WebCore::SliderThumbVerticalPart", taking false branch. Now the value of "part" is equal to 45.
3. webkitgtk-2.20.3/Source/WebCore/rendering/RenderThemeGtk.cpp:1307: between: At condition "part == WebCore::SliderHorizontalPart", the value of "part" must be between 44 and 45.
4. webkitgtk-2.20.3/Source/WebCore/rendering/RenderThemeGtk.cpp:1307: dead_error_condition: The condition "part == WebCore::SliderHorizontalPart" cannot be true.
5. webkitgtk-2.20.3/Source/WebCore/rendering/RenderThemeGtk.cpp:1307: dead_error_line: Execution cannot reach the expression "WebCore::RenderThemeWidget::Type::HorizontalSlider" inside this statement: "sliderWidget = static_cast<...".
#  1305|           return;
#  1306|   
#  1307|->     auto& sliderWidget = static_cast<RenderThemeSlider&>(RenderThemeWidget::getOrCreate(part == SliderHorizontalPart ? RenderThemeWidget::Type::HorizontalSlider : RenderThemeWidget::Type::VerticalSlider));
#  1308|       sliderWidget.scale().setState(GTK_STATE_FLAG_NORMAL);
#  1309|       sliderWidget.trough().setState(GTK_STATE_FLAG_NORMAL);
Comment 1 Tomas Popela 2018-06-18 04:10:59 PDT
Created attachment 342922 [details]
Patch
Comment 2 Carlos Garcia Campos 2018-06-18 04:15:14 PDT
Comment on attachment 342922 [details]
Patch

Good catch!
Comment 3 Michael Catanzaro 2018-06-18 06:36:02 PDT
Comment on attachment 342922 [details]
Patch

Clearing flags on attachment: 342922

Committed r232928: <https://trac.webkit.org/changeset/232928>
Comment 4 Michael Catanzaro 2018-06-18 06:36:04 PDT
All reviewed patches have been landed.  Closing bug.