diff options
Diffstat (limited to 'patches/source/rocs/patch/rocs')
-rw-r--r-- | patches/source/rocs/patch/rocs/97a1f41c4d79f471c36207ec4d86e1a346b8df83.patch | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/patches/source/rocs/patch/rocs/97a1f41c4d79f471c36207ec4d86e1a346b8df83.patch b/patches/source/rocs/patch/rocs/97a1f41c4d79f471c36207ec4d86e1a346b8df83.patch new file mode 100644 index 000000000..630acd127 --- /dev/null +++ b/patches/source/rocs/patch/rocs/97a1f41c4d79f471c36207ec4d86e1a346b8df83.patch @@ -0,0 +1,29 @@ +From 97a1f41c4d79f471c36207ec4d86e1a346b8df83 Mon Sep 17 00:00:00 2001 +From: Tomaz Canabrava <tcanabrava@kde.org> +Date: Tue, 14 Dec 2021 17:32:12 +0000 +Subject: [PATCH] I hate `auto`. This creates a QStringRref, not a QString, + then crashes. + +We can't pass a QStringRef to QUrl::fromLocalFile, this accepts +a const QString& and then QStringRef will decay to a QString() +but it's UB to hold a const ref to a temporary. +--- + src/project/project.cpp | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/project/project.cpp b/src/project/project.cpp +index 42e00bc0c..47d11912c 100644 +--- a/src/project/project.cpp ++++ b/src/project/project.cpp +@@ -205,7 +205,7 @@ QString Project::workingDir() const + + KTextEditor::Document* Project::createCodeDocument(const QString& filePath) + { +- auto path = d->m_workingDirectory.path() + QLatin1Char('/') + filePath + QStringLiteral(".js"); ++ const QString path = d->m_workingDirectory.path() + QLatin1Char('/') + filePath + QStringLiteral(".js"); + + auto doc = KTextEditor::Editor::instance()->createDocument(nullptr); + if (!doc->saveAs(QUrl::fromLocalFile(path))) { +-- +GitLab + |