From 768c4b4526b1e6340587d72b985005da786a8494 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Fri, 23 Jun 2017 14:20:50 +0200 Subject: YarrOp: Initialize members Fix GCC 7 warnings: 3rdparty\masm\yarr\YarrJIT.cpp:455:12: error: '.JSC::Yarr::YarrGenerator<(JSC::Yarr::YarrJITCompileMode)1>::YarrOp::m_alternative' may be used uninitialized in this function [-Werror=maybe-uninitialized] 3rdparty\masm\yarr\YarrJIT.cpp:455:12: error: '.JSC::Yarr::YarrGenerator<(JSC::Yarr::YarrJITCompileMode)1>::YarrOp::m_previousOp' may be used uninitialized in this function [-Werror=maybe-uninitialized] 3rdparty\masm\yarr\YarrJIT.cpp:455:12: error: '.JSC::Yarr::YarrGenerator<(JSC::Yarr::YarrJITCompileMode)1>::YarrOp::m_nextOp' may be used uninitialized in this function [-Werror=maybe-uninitialized] 3rdparty\masm\yarr\YarrJIT.cpp:455:12: error: '.JSC::Yarr::YarrGenerator<(JSC::Yarr::YarrJITCompileMode)1>::YarrOp::m_term' may be used uninitialized in this function [-Werror=maybe-uninitialized] Task-number: QTBUG-61558 Change-Id: I661f5455dd4cd57797d09edde9e097e17fb98dae Reviewed-by: Simon Hausmann --- src/3rdparty/masm/yarr/YarrJIT.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/3rdparty/masm') diff --git a/src/3rdparty/masm/yarr/YarrJIT.cpp b/src/3rdparty/masm/yarr/YarrJIT.cpp index e4f2d97759..71123b7be7 100644 --- a/src/3rdparty/masm/yarr/YarrJIT.cpp +++ b/src/3rdparty/masm/yarr/YarrJIT.cpp @@ -468,16 +468,16 @@ class YarrGenerator : private DefaultMacroAssembler { // The operation, as a YarrOpCode, and also a reference to the PatternTerm. YarrOpCode m_op; - PatternTerm* m_term; + PatternTerm* m_term = nullptr; // For alternatives, this holds the PatternAlternative and doubly linked // references to this alternative's siblings. In the case of the // OpBodyAlternativeEnd node at the end of a section of repeating nodes, // m_nextOp will reference the OpBodyAlternativeBegin node of the first // repeating alternative. - PatternAlternative* m_alternative; - size_t m_previousOp; - size_t m_nextOp; + PatternAlternative* m_alternative = nullptr; + size_t m_previousOp = 0; + size_t m_nextOp = 0; // Used to record a set of Jumps out of the generated code, typically // used for jumps out to backtracking code, and a single reentry back -- cgit v1.2.3 From 45420ef4b06b6039ac09f813c964c1b037a485f1 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Fri, 23 Jun 2017 14:31:01 +0200 Subject: Yarr: Add Q_FALLTHROUGH to fallthroughs detected by GCC 7 Change-Id: I99dcca18155eeef1fdaec8d7693a6a415a68b55b Reviewed-by: Simon Hausmann --- src/3rdparty/masm/yarr/YarrParser.h | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src/3rdparty/masm') diff --git a/src/3rdparty/masm/yarr/YarrParser.h b/src/3rdparty/masm/yarr/YarrParser.h index 8c5d71b5fe..13ffd3a1d6 100644 --- a/src/3rdparty/masm/yarr/YarrParser.h +++ b/src/3rdparty/masm/yarr/YarrParser.h @@ -118,7 +118,7 @@ private: m_state = AfterCharacterClassHyphen; return; } - // Otherwise just fall through - cached character so treat this as Empty. + Q_FALLTHROUGH(); // cached character, so treat this as Empty. case Empty: m_character = ch; @@ -168,6 +168,7 @@ private: case CachedCharacter: // Flush the currently cached character, then fall through. m_delegate.atomCharacterClassAtom(m_character); + Q_FALLTHROUGH(); case Empty: case AfterCharacterClass: @@ -347,9 +348,8 @@ private: delegate.atomPatternCharacter('\\'); break; } - - // Fall-through to handle this as an octal escape. } + Q_FALLTHROUGH(); // Handle this as an octal escape. // Octal escape case '0': @@ -656,7 +656,8 @@ private: } restoreState(state); - } // if we did not find a complete quantifer, fall through to the default case. + } + Q_FALLTHROUGH(); // if we did not find a complete quantifer, fall through to the default case. default: m_delegate.atomPatternCharacter(consume()); -- cgit v1.2.3