From 8f5fa5aa3c69e9105de898c8cb2641026167573b Mon Sep 17 00:00:00 2001 From: Bart Ribbers Date: Thu, 24 Oct 2019 14:26:16 +0200 Subject: community/libsass: fix some cases of "extend" causing an endless loop breeze-gtk encountered this and had to be prevented from upgrading because of it --- ...ix-trim-loop-condition-and-outer-continue.patch | 36 ++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 community/libsass/fix-trim-loop-condition-and-outer-continue.patch (limited to 'community/libsass/fix-trim-loop-condition-and-outer-continue.patch') diff --git a/community/libsass/fix-trim-loop-condition-and-outer-continue.patch b/community/libsass/fix-trim-loop-condition-and-outer-continue.patch new file mode 100644 index 0000000000..b1c2acf455 --- /dev/null +++ b/community/libsass/fix-trim-loop-condition-and-outer-continue.patch @@ -0,0 +1,36 @@ +From fdf63e4c93d40c1c4da43fdf13010d590dc133e0 Mon Sep 17 00:00:00 2001 +From: Marcel Greter +Date: Sun, 20 Oct 2019 04:45:29 +0200 +Subject: [PATCH] Fix trim loop condition and outer continue + +--- + src/extender.cpp | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +diff --git a/src/extender.cpp b/src/extender.cpp +index 2ae54df98..b0add3857 100644 +--- a/src/extender.cpp ++++ b/src/extender.cpp +@@ -1070,10 +1070,10 @@ namespace Sass { + // the result so that, if two selectors are identical, we keep the first one. + std::vector result; size_t numOriginals = 0; + +- // Use label to quit outer loop +- redo: ++ size_t i = selectors.size(); ++ outer: // Use label to continue loop ++ while (--i != std::string::npos) { + +- for (size_t i = selectors.size() - 1; i != std::string::npos; i--) { + const ComplexSelectorObj& complex1 = selectors[i]; + // Check if selector in known in existing "originals" + // For custom behavior dart-sass had `isOriginal(complex1)` +@@ -1083,7 +1083,7 @@ namespace Sass { + for (size_t j = 0; j < numOriginals; j++) { + if (ObjEqualityFn(result[j], complex1)) { + rotateSlice(result, 0, j + 1); +- goto redo; ++ goto outer; + } + } + result.insert(result.begin(), complex1); -- cgit v1.2.3