From: Uwe Hermann Date: Sat, 23 Nov 2019 18:38:46 +0000 (+0100) Subject: views/trace: Fix two -fsanitize=undefined issues. X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=4ab6d24485f67ad264ba04b54f9e2562a9fe458d;p=pulseview.git views/trace: Fix two -fsanitize=undefined issues. Two variables were being accessed before initialization in some cases. pv/views/trace/view.cpp:1199:6: runtime error: load of value 124, which is not a valid value for type 'bool' pv/views/trace/view.cpp:1199:6: runtime error: load of value 105, which is not a valid value for type 'bool' pv/views/trace/cursorpair.cpp:252:7: runtime error: load of value 24, which is not a valid value for type 'bool' pv/views/trace/cursorpair.cpp:252:7: runtime error: load of value 200, which is not a valid value for type 'bool' --- diff --git a/pv/views/trace/cursorpair.cpp b/pv/views/trace/cursorpair.cpp index ba65e6c1..3e3a6b8e 100644 --- a/pv/views/trace/cursorpair.cpp +++ b/pv/views/trace/cursorpair.cpp @@ -45,7 +45,8 @@ const int CursorPair::DeltaPadding = 8; CursorPair::CursorPair(View &view) : TimeItem(view), first_(new Cursor(view, 0.0)), - second_(new Cursor(view, 1.0)) + second_(new Cursor(view, 1.0)), + label_incomplete_(true) { GlobalSettings::add_change_handler(this); diff --git a/pv/views/trace/view.cpp b/pv/views/trace/view.cpp index f2a3335e..4ee79162 100644 --- a/pv/views/trace/view.cpp +++ b/pv/views/trace/view.cpp @@ -130,7 +130,8 @@ View::View(Session &session, bool is_main_view, QWidget *parent) : // Note: Place defaults in View::reset_view_state(), not here splitter_(new QSplitter()), header_was_shrunk_(false), // The splitter remains unchanged after a reset, so this goes here - sticky_scrolling_(false) // Default setting is set in MainWindow::setup_ui() + sticky_scrolling_(false), // Default setting is set in MainWindow::setup_ui() + scroll_needs_defaults_(true) { QVBoxLayout *root_layout = new QVBoxLayout(this); root_layout->setContentsMargins(0, 0, 0, 0);