Skip to content

Commit 86208ed

Browse files
committed
Fix #269 and #273
1 parent ed84bb7 commit 86208ed

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

peglib.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1003,6 +1003,9 @@ class PrioritizedChoice : public Ope {
10031003
size_t len = static_cast<size_t>(-1);
10041004

10051005
if (!for_label_) { c.cut_stack.push_back(false); }
1006+
auto se = scope_exit([&]() {
1007+
if (!for_label_) { c.cut_stack.pop_back(); }
1008+
});
10061009

10071010
size_t id = 0;
10081011
for (const auto &ope : opes_) {
@@ -1030,8 +1033,6 @@ class PrioritizedChoice : public Ope {
10301033
id++;
10311034
}
10321035

1033-
if (!for_label_) { c.cut_stack.pop_back(); }
1034-
10351036
return len;
10361037
}
10371038

0 commit comments

Comments
 (0)