summaryrefslogtreecommitdiff
path: root/proto.h
diff options
context:
space:
mode:
authorKarl Williamson <public@khwilliamson.com>2012-12-27 10:25:48 -0700
committerKarl Williamson <public@khwilliamson.com>2012-12-28 10:38:53 -0700
commitf799ce5b1c4ca739689451f7214896b548302a75 (patch)
tree26c583be03c1270c9951bab54b4cc7405b1fd026 /proto.h
parent9f68b0f7acd1bcb04e7baa4bdb7cfec8e5d985c8 (diff)
downloadperl-f799ce5b1c4ca739689451f7214896b548302a75.tar.gz
regcomp.c: Don't iterate while changing an inversion list
This adds functions to prevent accidental (or deliberate) iteration over an inversion list while it is being modified. This is to catch development errors, and in production builds, the asserts() are likely no-ops
Diffstat (limited to 'proto.h')
-rw-r--r--proto.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/proto.h b/proto.h
index 1151167d64..d9435b59ca 100644
--- a/proto.h
+++ b/proto.h
@@ -6509,6 +6509,17 @@ PERL_STATIC_INLINE UV S_invlist_highest(pTHX_ SV* const invlist)
#define PERL_ARGS_ASSERT_INVLIST_HIGHEST \
assert(invlist)
+PERL_STATIC_INLINE bool S_invlist_is_iterating(pTHX_ SV* const invlist)
+ __attribute__warn_unused_result__
+ __attribute__nonnull__(pTHX_1);
+#define PERL_ARGS_ASSERT_INVLIST_IS_ITERATING \
+ assert(invlist)
+
+STATIC void S_invlist_iterfinish(pTHX_ SV* invlist)
+ __attribute__nonnull__(pTHX_1);
+#define PERL_ARGS_ASSERT_INVLIST_ITERFINISH \
+ assert(invlist)
+
PERL_STATIC_INLINE void S_invlist_iterinit(pTHX_ SV* invlist)
__attribute__nonnull__(pTHX_1);
#define PERL_ARGS_ASSERT_INVLIST_ITERINIT \