summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDagfinn Ilmari Mannsåker <ilmari@ilmari.org>2019-02-15 11:15:03 +0000
committerDagfinn Ilmari Mannsåker <ilmari@ilmari.org>2019-02-15 11:23:35 +0000
commitde8aedb225e5852b32ab9143c1cc234e65af26ba (patch)
tree3ffab06fdc85f2019d214c346895acda7d7343a0
parentbe76079c87db438e1123ff79ee161badcb258605 (diff)
downloadperl-de8aedb225e5852b32ab9143c1cc234e65af26ba.tar.gz
Use STATIC_ASSERT_STMT for checking compile-time invariants
Better to have the build fail if they're wrong than relying on the code path being hit at runtime in a DEBUGGING build.
-rw-r--r--regcomp.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/regcomp.c b/regcomp.c
index 41d2582aad..088b1df7cd 100644
--- a/regcomp.c
+++ b/regcomp.c
@@ -18989,9 +18989,8 @@ Perl__get_regclass_nonbitmap_data(pTHX_ const regexp *prog,
invlist = prop_definition;
}
- assert(ONLY_LOCALE_MATCHES_INDEX == 1 + INVLIST_INDEX);
- assert(DEFERRED_USER_DEFINED_INDEX == 1
- + ONLY_LOCALE_MATCHES_INDEX);
+ STATIC_ASSERT_STMT(ONLY_LOCALE_MATCHES_INDEX == 1 + INVLIST_INDEX);
+ STATIC_ASSERT_STMT(DEFERRED_USER_DEFINED_INDEX == 1 + ONLY_LOCALE_MATCHES_INDEX);
av_store(av, INVLIST_INDEX, invlist);
av_fill(av, (ary[ONLY_LOCALE_MATCHES_INDEX])