From dc18c3d017e1367d56884349a0889ef77a5cab6d Mon Sep 17 00:00:00 2001 From: yhirose Date: Sun, 31 Jul 2022 07:16:45 -0400 Subject: [PATCH] Fix #237 --- peglib.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/peglib.h b/peglib.h index 47dd3da..6be2b14 100644 --- a/peglib.h +++ b/peglib.h @@ -1576,7 +1576,7 @@ class Cut : public Ope, public std::enable_shared_from_this { public: size_t parse_core(const char * /*s*/, size_t /*n*/, SemanticValues & /*vs*/, Context &c, std::any & /*dt*/) const override { - c.cut_stack.back() = true; + if (!c.cut_stack.empty()) { c.cut_stack.back() = true; } return 0; }