From 60e29921582e47199dc02ee6de9465b8a2067475 Mon Sep 17 00:00:00 2001 From: sogaiu <983021772@users.noreply.github.com> Date: Wed, 10 Feb 2021 08:33:46 +0900 Subject: [PATCH] Tweak spec_readint --- 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 ba0f0a8a..b3445521 100644 --- a/src/core/peg.c +++ b/src/core/peg.c @@ -1027,7 +1027,7 @@ static void spec_matchtime(Builder *b, int32_t argc, const Janet *argv) { static void spec_readint(Builder *b, int32_t argc, const Janet *argv, uint32_t mask) { peg_arity(b, argc, 1, 2); Reserve r = reserve(b, 3); - uint32_t tag = (argc == 2) ? emit_tag(b, argv[3]) : 0; + uint32_t tag = (argc == 2) ? emit_tag(b, argv[1]) : 0; int32_t width = peg_getnat(b, argv[0]); if ((width < 0) || (width > JANET_MAX_READINT_WIDTH)) { peg_panicf(b, "width must be between 0 and %d, got %d", JANET_MAX_READINT_WIDTH, width);