From cc8af69427466b91a81167e24e583e8638b32949 Mon Sep 17 00:00:00 2001 From: Yves Orton Date: Fri, 13 Jan 2023 20:37:01 +0100 Subject: embed.pl - add a way to declare a parameter should be non-zero This autogenerates the required asserts to validate a parameter is non-zero. It uses it to replace the check in regrepeat() as a first example. --- proto.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'proto.h') diff --git a/proto.h b/proto.h index a834b7867c..157a25041d 100644 --- a/proto.h +++ b/proto.h @@ -8819,7 +8819,8 @@ STATIC I32 S_regrepeat(pTHX_ regexp *prog, char **startposp, const regnode *p, char *loceol, regmatch_info * const reginfo, I32 max _pDEPTH) __attribute__warn_unused_result__; # define PERL_ARGS_ASSERT_REGREPEAT \ - assert(prog); assert(startposp); assert(p); assert(loceol); assert(reginfo) + assert(prog); assert(startposp); assert(p); assert(loceol); assert(reginfo); \ + assert(max) STATIC bool S_regtry(pTHX_ regmatch_info *reginfo, char **startposp) -- cgit v1.2.1