Skip to content

Commit

Permalink
Perl_variant_byte_number: Move assert()
Browse files Browse the repository at this point in the history
This should be called only when it is known there is a variant byte.
The assert() previously wasn't checking that precisely
  • Loading branch information
khwilliamson committed Jun 14, 2021
1 parent 26ae566 commit 603233a
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions inline.h
Expand Up @@ -590,11 +590,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
Expand Down

0 comments on commit 603233a

Please sign in to comment.