From e615875676e357cae7ff37441ffc2d44f0daa94e Mon Sep 17 00:00:00 2001 From: David Mitchell Date: Fri, 20 Sep 2019 11:11:36 +0100 Subject: [PATCH] Signatures: change param count from IV to UV For some reason I was storing the counts of sub signature parameters and optional parameters as signed ints. Since these can never be negative, change them to UV instead. --- op.h | 4 ++-- parser.h | 4 ++-- pp.c | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/op.h b/op.h index 7444965274..80b1d9c59c 100644 --- a/op.h +++ b/op.h @@ -1116,8 +1116,8 @@ C is non-null. For a higher-level interface, see C>. /* stuff for OP_ARGCHECK */ struct op_argcheck_aux { - IV params; /* number of positional parameters */ - IV opt_params; /* number of optional positional parameters */ + UV params; /* number of positional parameters */ + UV opt_params; /* number of optional positional parameters */ char slurpy; /* presence of slurpy: may be '\0', '@' or '%' */ }; diff --git a/parser.h b/parser.h index 19c5c63ad3..4fa490a190 100644 --- a/parser.h +++ b/parser.h @@ -114,8 +114,8 @@ typedef struct yy_parser { bool sig_seen; /* the currently parsing sub has a signature */ /* these are valid while parsing a subroutine signature */ - IV sig_elems; /* number of signature elements seen so far */ - IV sig_optelems; /* number of optional signature elems seen */ + UV sig_elems; /* number of signature elements seen so far */ + UV sig_optelems; /* number of optional signature elems seen */ char sig_slurpy; /* the sigil of the slurpy var (or null) */ bool recheck_utf8_validity; diff --git a/pp.c b/pp.c index f33569435e..062d0f2e37 100644 --- a/pp.c +++ b/pp.c @@ -7119,8 +7119,8 @@ PP(pp_argcheck) { OP * const o = PL_op; struct op_argcheck_aux *aux = (struct op_argcheck_aux *)cUNOP_AUXo->op_aux; - IV params = aux->params; - IV opt_params = aux->opt_params; + UV params = aux->params; + UV opt_params = aux->opt_params; char slurpy = aux->slurpy; AV *defav = GvAV(PL_defgv); /* @_ */ IV argc;