diff options
author | Bart Ribbers <bribbers@disroot.org> | 2019-10-24 14:26:16 +0200 |
---|---|---|
committer | Leo <thinkabit.ukim@gmail.com> | 2019-10-24 09:42:17 -0300 |
commit | 8f5fa5aa3c69e9105de898c8cb2641026167573b (patch) | |
tree | 1eef4a125881d62e9826ecf6adfa5bb0c2793b31 /community/libsass/fix-trim-loop-condition-and-outer-continue.patch | |
parent | 0c67cd1eba2f8985bf99a3d59c014e31866f0e35 (diff) | |
download | aports-8f5fa5aa3c69e9105de898c8cb2641026167573b.tar.bz2 aports-8f5fa5aa3c69e9105de898c8cb2641026167573b.tar.xz |
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
Diffstat (limited to 'community/libsass/fix-trim-loop-condition-and-outer-continue.patch')
-rw-r--r-- | community/libsass/fix-trim-loop-condition-and-outer-continue.patch | 36 |
1 files changed, 36 insertions, 0 deletions
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 <marcel.greter@ocbnet.ch> +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<ComplexSelectorObj> 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); |