Add assertion for decreasing the indent

Co-authored-by: Théophane Hufschmitt <7226587+thufschmitt@users.noreply.github.com>
This commit is contained in:
Rebecca Turner 2024-02-08 10:11:45 -08:00 committed by GitHub
parent c0a15fb7d0
commit a27651908f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -176,6 +176,7 @@ private:
void decreaseIndent() void decreaseIndent()
{ {
if (options.prettyPrint()) { if (options.prettyPrint()) {
assert(indent.size() >= options.prettyIndent);
indent.resize(indent.size() - options.prettyIndent); indent.resize(indent.size() - options.prettyIndent);
} }
} }