From b442b21d3f304f18647165e46c62de7b6a72fac1 Mon Sep 17 00:00:00 2001 From: Ian Henry Date: Mon, 20 Feb 2023 17:04:12 -0800 Subject: [PATCH] fix a segfault in the (number) special This was an error about the base argument that referenced the tag argument, which might not exist. --- src/core/peg.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/peg.c b/src/core/peg.c index 236d497b..b7de920d 100644 --- a/src/core/peg.c +++ b/src/core/peg.c @@ -1034,7 +1034,7 @@ static void spec_capture_number(Builder *b, int32_t argc, const Janet *argv) { emit_3(r, RULE_CAPTURE_NUM, rule, base, tag); return; error: - peg_panicf(b, "expected integer between 2 and 36, got %v", argv[2]); + peg_panicf(b, "expected integer between 2 and 36, got %v", argv[1]); } static void spec_reference(Builder *b, int32_t argc, const Janet *argv) {