From 274208291baee708e16ad2e25fbbb32ea8be8ffa Mon Sep 17 00:00:00 2001 From: Karl Williamson Date: Tue, 16 Dec 2025 11:05:13 -0700 Subject: [PATCH] embed.fnc: Change EPTR assert for sv_pos_u2b_foo to gt These internal functions can handle empty strings, but it aren't called with those so far, and it is better practice to not call them with an empty string, so guard against it now. --- embed.fnc | 6 +++--- proto.h | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/embed.fnc b/embed.fnc index 15ac778b6e..b3d92cd82d 100644 --- a/embed.fnc +++ b/embed.fnc @@ -6125,19 +6125,19 @@ S |STRLEN |sv_pos_u2b_cached \ |NN SV * const sv \ |NN MAGIC ** const mgp \ |SPTR const U8 * const start \ - |EPTRge const U8 * const send \ + |EPTRgt const U8 * const send \ |STRLEN uoffset \ |STRLEN uoffset0 \ |STRLEN boffset0 ST |STRLEN |sv_pos_u2b_forwards \ |SPTR const U8 * const start \ - |EPTRge const U8 * const send \ + |EPTRgt const U8 * const send \ |NN STRLEN * const uoffset \ |NN bool * const at_end \ |NN bool *canonical_position ST |STRLEN |sv_pos_u2b_midway \ |SPTR const U8 * const start \ - |EPTRge const U8 *send \ + |EPTRgt const U8 *send \ |STRLEN uoffset \ |const STRLEN uend i |void |sv_unglob |NN SV * const sv \ diff --git a/proto.h b/proto.h index ac0fb1c1c8..625e422e03 100644 --- a/proto.h +++ b/proto.h @@ -9292,18 +9292,18 @@ STATIC STRLEN S_sv_pos_u2b_cached(pTHX_ SV * const sv, MAGIC ** const mgp, const U8 * const start, const U8 * const send, STRLEN uoffset, STRLEN uoffset0, STRLEN boffset0); # define PERL_ARGS_ASSERT_SV_POS_U2B_CACHED \ assert(sv); assert(mgp); assert(start); assert(send); \ - assert(start <= send) + assert(start < send) STATIC STRLEN S_sv_pos_u2b_forwards(const U8 * const start, const U8 * const send, STRLEN * const uoffset, bool * const at_end, bool *canonical_position); # define PERL_ARGS_ASSERT_SV_POS_U2B_FORWARDS \ assert(start); assert(send); assert(uoffset); assert(at_end); \ - assert(canonical_position); assert(start <= send) + assert(canonical_position); assert(start < send) STATIC STRLEN S_sv_pos_u2b_midway(const U8 * const start, const U8 *send, STRLEN uoffset, const STRLEN uend); # define PERL_ARGS_ASSERT_SV_POS_U2B_MIDWAY \ - assert(start); assert(send); assert(start <= send) + assert(start); assert(send); assert(start < send) STATIC void S_utf8_mg_len_cache_update(pTHX_ SV * const sv, MAGIC ** const mgp, const STRLEN ulen);