From a27651908fc1b5ef73a81e46434a408c5868fa7b Mon Sep 17 00:00:00 2001 From: Rebecca Turner Date: Thu, 8 Feb 2024 10:11:45 -0800 Subject: [PATCH] Add assertion for decreasing the indent MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Théophane Hufschmitt <7226587+thufschmitt@users.noreply.github.com> --- src/libexpr/print.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/src/libexpr/print.cc b/src/libexpr/print.cc index 1ff026b3db3..cdc9f6dbeec 100644 --- a/src/libexpr/print.cc +++ b/src/libexpr/print.cc @@ -176,6 +176,7 @@ class Printer void decreaseIndent() { if (options.prettyPrint()) { + assert(indent.size() >= options.prettyIndent); indent.resize(indent.size() - options.prettyIndent); } }