mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-05-20 11:40:18 +02:00
Fix signed/unsigned mismatch in `scm_array_handle_{ref,set} ()'.
* libguile/inline.h (scm_array_handle_ref, scm_array_handle_set): Cast `h->base' so that it matches the signedness of `p'.
This commit is contained in:
parent
5ebc8b8141
commit
c72b0ca3b0
1 changed files with 2 additions and 2 deletions
|
@ -243,7 +243,7 @@ SCM_C_EXTERN_INLINE
|
|||
SCM
|
||||
scm_array_handle_ref (scm_t_array_handle *h, ssize_t p)
|
||||
{
|
||||
if (SCM_UNLIKELY (p < 0 && -p > h->base))
|
||||
if (SCM_UNLIKELY (p < 0 && -p > (ssize_t) h->base))
|
||||
/* catch overflow */
|
||||
scm_out_of_range (NULL, scm_from_ssize_t (p));
|
||||
/* perhaps should catch overflow here too */
|
||||
|
@ -256,7 +256,7 @@ SCM_C_EXTERN_INLINE
|
|||
void
|
||||
scm_array_handle_set (scm_t_array_handle *h, ssize_t p, SCM v)
|
||||
{
|
||||
if (SCM_UNLIKELY (p < 0 && -p > h->base))
|
||||
if (SCM_UNLIKELY (p < 0 && -p > (ssize_t) h->base))
|
||||
/* catch overflow */
|
||||
scm_out_of_range (NULL, scm_from_ssize_t (p));
|
||||
/* perhaps should catch overflow here too */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue