From 6dfd8e20543d204ff45d67adb212ca4e8e91bb6f Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Mon, 1 Feb 2021 17:34:02 +0100 Subject: shiboken6: Fix a crash when printing clang diagnostics The CXFile struct used in the Diagnostic struct representing a diagnostic message is invalid after clang parsing has finished and causes a crash when printing. Expand it to a QString at creation time. Apparently, this occurred with recent clang versions. Change-Id: I297014e272d6814f04e8f0273e8ae79ab8264138 Reviewed-by: Christian Tismer (cherry picked from commit 9da07f8145b38f4483fed94fbc3148af872b08ec) Reviewed-by: Cristian Maureira-Fredes --- sources/shiboken2/ApiExtractor/clangparser/clangutils.h | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'sources/shiboken2/ApiExtractor/clangparser/clangutils.h') diff --git a/sources/shiboken2/ApiExtractor/clangparser/clangutils.h b/sources/shiboken2/ApiExtractor/clangparser/clangutils.h index 41d0af460..f7c230a66 100644 --- a/sources/shiboken2/ApiExtractor/clangparser/clangutils.h +++ b/sources/shiboken2/ApiExtractor/clangparser/clangutils.h @@ -68,7 +68,7 @@ struct SourceLocation { bool equals(const SourceLocation &rhs) const; - CXFile file; + CXFile file = nullptr; unsigned line = 0; unsigned column = 0; unsigned offset = 0; @@ -96,10 +96,14 @@ struct Diagnostic { static Diagnostic fromCXDiagnostic(CXDiagnostic cd); // Other explicit Diagnostic(const QString &m, const CXCursor &c, CXDiagnosticSeverity s = CXDiagnostic_Warning); + void setLocation(const SourceLocation &); QString message; QStringList childMessages; - SourceLocation location; + QString file; + unsigned line = 0; + unsigned column = 0; + unsigned offset = 0; Source source = Clang; CXDiagnosticSeverity severity = CXDiagnostic_Warning; }; -- cgit v1.2.3 From 50c76a779bd1343a60ec091f728586db39067884 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Fri, 5 Mar 2021 18:14:27 +0100 Subject: Change the LTS 5.15 branch to a commercial license MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Task-number: QTQAINFRA-4142 Change-Id: I15aaa7d4f0a44531de4554bb177dd3ade20f56a6 Reviewed-by: Cristian Maureira-Fredes Reviewed-by: Simo Fält --- sources/shiboken2/ApiExtractor/clangparser/clangutils.h | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) (limited to 'sources/shiboken2/ApiExtractor/clangparser/clangutils.h') diff --git a/sources/shiboken2/ApiExtractor/clangparser/clangutils.h b/sources/shiboken2/ApiExtractor/clangparser/clangutils.h index f7c230a66..239136da9 100644 --- a/sources/shiboken2/ApiExtractor/clangparser/clangutils.h +++ b/sources/shiboken2/ApiExtractor/clangparser/clangutils.h @@ -1,11 +1,12 @@ /**************************************************************************** ** -** Copyright (C) 2017 The Qt Company Ltd. +** Copyright (C) 2021 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of Qt for Python. ** -** $QT_BEGIN_LICENSE:GPL-EXCEPT$ +** $QT_BEGIN_LICENSE:COMM$ +** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the @@ -14,14 +15,6 @@ ** and conditions see https://www.qt.io/terms-conditions. For further ** information use the contact form at https://www.qt.io/contact-us. ** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 as published by the Free Software -** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-3.0.html. -** ** $QT_END_LICENSE$ ** ****************************************************************************/ -- cgit v1.2.3