diff options
author | Tony Cook <tony@develop-help.com> | 2022-11-14 14:00:38 +1100 |
---|---|---|
committer | James E Keenan <jkeenan@cpan.org> | 2022-11-18 17:51:43 -0500 |
commit | 0507844a31371da4dbf9136341e30487e5a9b5a8 (patch) | |
tree | d2c8f3b0202bf3652fca4b664700c85105e8d053 /scope.h | |
parent | decc3ce8213259c446820ae1f87d793000287fd4 (diff) | |
download | perl-0507844a31371da4dbf9136341e30487e5a9b5a8.tar.gz |
relax the assertion in SSPTR() and SSPTRt()
I added assertions in SSPTR() and SSPTRt() to try to ensure the new
SSize_t result from SSNEW*() wouldn't be truncated, but this
was too strict, requiring that the size matched exactly.
Relax this to allow the input offset to be the same or larger than
SSize_t.
Fixes #20504.
Diffstat (limited to 'scope.h')
-rw-r--r-- | scope.h | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -283,8 +283,8 @@ casts it to a pointer of that C<type>. (I32)(align - ((size_t)((caddr_t)&PL_savestack[PL_savestack_ix]) % align)) % align) #define SSNEWat(n,t,align) SSNEWa((n)*sizeof(t), align) -#define SSPTR(off,type) (assert(sizeof(off) == sizeof(SSize_t)), (type) ((char*)PL_savestack + off)) -#define SSPTRt(off,type) (assert(sizeof(off) == sizeof(SSize_t)), (type*) ((char*)PL_savestack + off)) +#define SSPTR(off,type) (assert(sizeof(off) >= sizeof(SSize_t)), (type) ((char*)PL_savestack + off)) +#define SSPTRt(off,type) (assert(sizeof(off) >= sizeof(SSize_t)), (type*) ((char*)PL_savestack + off)) #define save_freesv(op) save_pushptr((void *)(op), SAVEt_FREESV) #define save_mortalizesv(op) save_pushptr((void *)(op), SAVEt_MORTALIZESV) |