regcomp_invlist.c: Perl_populate_bitmap_from_invlist() optimize asserts #23376
+7
−1
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Inside re.xs/re.dll, Perl_populate_bitmap_from_invlist() has half a dozen if(!invlist) _assert_libc() call sites. Atleast
PERL_ARGS_ASSERT_POPULATE_BITMAP_FROM_INVLIST, invlist_iterinit(), invlist_iternext(), invlist_iterfinish() are all testing a C auto var that was proven inside PERL_ARGS_ASSERT_POPULATE_BITMAP_FROM_INVLIST to be true. "SV * invlist" is a C auto and I don't belive it is "reachable" under ISO C. Perl_populate_bitmap_from_invlist() never does & operator on it. But atleast MSVC 2022 is constantly re-reading this C auto. Also Perl_populate_bitmap_from_invlist() has only 1 call site, and MSVC hoisted/folded/inlined away "const Size_t len" since its always 8.
#define REGNODE_BBM_BITMAP_LEN /* 6 info bits requires 64 bits; 5 => 32 */ ((1 << (UTF_CONTINUATION_BYTE_INFO_BITS)) / CHARBITS)
since MSVC doesnt inline memcpy symbol func calls b/c WinPerl doesnt request it, make it obvious here to skip the libc call on all platforms.