##// END OF EJS Templates
revset: prevent crash caused by empty group expression while optimizing "or"...
Yuya Nishihara -
r25996:b12e00a0 stable
parent child Browse files
Show More
@@ -2280,7 +2280,7 b' def optimize(x, small):'
2280 del ss[:]
2280 del ss[:]
2281 for y in x[1:]:
2281 for y in x[1:]:
2282 w, t = optimize(y, False)
2282 w, t = optimize(y, False)
2283 if t[0] == 'string' or t[0] == 'symbol':
2283 if t is not None and (t[0] == 'string' or t[0] == 'symbol'):
2284 ss.append((w, t))
2284 ss.append((w, t))
2285 continue
2285 continue
2286 flushss()
2286 flushss()
@@ -1144,6 +1144,20 b' test that chained `or` operations make b'
1144 4
1144 4
1145 5
1145 5
1146
1146
1147 no crash by empty group "()" while optimizing `or` operations
1148
1149 $ try --optimize '0|()'
1150 (or
1151 ('symbol', '0')
1152 (group
1153 None))
1154 * optimized:
1155 (or
1156 ('symbol', '0')
1157 None)
1158 hg: parse error: missing argument
1159 [255]
1160
1147 test that chained `or` operations never eat up stack (issue4624)
1161 test that chained `or` operations never eat up stack (issue4624)
1148 (uses `0:1` instead of `0` to avoid future optimization of trivial revisions)
1162 (uses `0:1` instead of `0` to avoid future optimization of trivial revisions)
1149
1163
General Comments 0
You need to be logged in to leave comments. Login now