summaryrefslogtreecommitdiff
path: root/inline.h
diff options
context:
space:
mode:
authorKarl Williamson <khw@cpan.org>2021-06-05 08:57:37 -0600
committerKarl Williamson <khw@cpan.org>2021-07-30 05:41:28 -0600
commit58ddb8c5c1121d947ee72818b81ee254edb17699 (patch)
treefae616d14a764f6b066abc78d41a73cbb7467036 /inline.h
parent8a6ab0a2b6184deb2f9a99f0a9622e8f836de4bd (diff)
downloadperl-58ddb8c5c1121d947ee72818b81ee254edb17699.tar.gz
Perl_variant_byte_number: Move assert()
This should be called only when it is known there is a variant byte. The assert() previously wasn't checking that precisely
Diffstat (limited to 'inline.h')
-rw-r--r--inline.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/inline.h b/inline.h
index 42e1ae7bf4..2a2cfb3a95 100644
--- a/inline.h
+++ b/inline.h
@@ -712,11 +712,13 @@ Perl_variant_byte_number(PERL_UINTMAX_T word)
/* This returns the position in a word (0..7) of the first variant byte in
* it. This is a helper function. Note that there are no branches */
- assert(word);
-
/* Get just the msb bits of each byte */
word &= PERL_VARIANTS_WORD_MASK;
+ /* This should only be called if we know there is a variant byte in the
+ * word */
+ assert(word);
+
# if BYTEORDER == 0x1234 || BYTEORDER == 0x12345678
/* Bytes are stored like