File tree Expand file tree Collapse file tree 2 files changed +56
-2
lines changed
Expand file tree Collapse file tree 2 files changed +56
-2
lines changed Original file line number Diff line number Diff line change @@ -159,7 +159,7 @@ std::vector<SuffixTree::RepeatedSubstring> StringifyProcessor::removeOverlaps(
159159 for (auto startIdx : substring.StartIndices ) {
160160 auto interval =
161161 Interval (startIdx,
162- startIdx + substring.Length ,
162+ startIdx + substring.Length - 1 ,
163163 substring.Length * substring.StartIndices .size ());
164164 intervals.push_back (interval);
165165 intervalMap[std::move (interval)] = i;
@@ -173,7 +173,7 @@ std::vector<SuffixTree::RepeatedSubstring> StringifyProcessor::removeOverlaps(
173173 doNotInclude.insert (intervalMap[interval]);
174174 }
175175
176- // Only include non-overlapping substrings
176+ // Construct a result with only the substrings that don't overlap
177177 std::vector<SuffixTree::RepeatedSubstring> result;
178178 for (Index i = 0 ; i < substrings.size (); i++) {
179179 if (doNotInclude.find (i) != doNotInclude.end ()) {
Original file line number Diff line number Diff line change 10061006 (loop (nop ))
10071007 )
10081008)
1009+
1010+ ;; Test that no attempt is made to outline overlapping repeat substrings
1011+ (module
1012+ (func $a
1013+ (drop (i32.add
1014+ (i32.const 0 )
1015+ (i32.const 1 )
1016+ ))
1017+ (drop (i32.sub
1018+ (i32.const 2 )
1019+ (i32.const 3 )
1020+ ))
1021+ (drop (i32.mul
1022+ (i32.const 4 )
1023+ (i32.const 5 )
1024+ ))
1025+ (drop (i32.div_u
1026+ (i32.const 6 )
1027+ (i32.const 7 )
1028+ ))
1029+ (drop (i32.add
1030+ (i32.const 0 )
1031+ (i32.const 1 )
1032+ ))
1033+ (drop (i32.sub
1034+ (i32.const 2 )
1035+ (i32.const 3 )
1036+ ))
1037+ (drop (i32.mul
1038+ (i32.const 4 )
1039+ (i32.const 5 )
1040+ ))
1041+ (drop (i32.div_u
1042+ (i32.const 6 )
1043+ (i32.const 7 )
1044+ ))
1045+ (drop (i32.sub
1046+ (i32.const 2 )
1047+ (i32.const 3 )
1048+ ))
1049+ (drop (i32.mul
1050+ (i32.const 4 )
1051+ (i32.const 5 )
1052+ ))
1053+ (drop (i32.sub
1054+ (i32.const 2 )
1055+ (i32.const 3 )
1056+ ))
1057+ (drop (i32.mul
1058+ (i32.const 4 )
1059+ (i32.const 5 )
1060+ ))
1061+ )
1062+ )
You can’t perform that action at this time.
0 commit comments