Re: gauche.bitvector bug with somewhat bigger vectors (2^31)

Shiro Kawai <[email protected]> Wed, 6 May 2026 20:36:28 -1000
Newsgroups gmane.lisp.scheme.gauche
Message-ID <CALN0JNFr+cwsKFPaQvguU8t1-ZcqQszcLQEiiW2Aom8u9das+A@mail.gmail.com>
--===============4683823985235962007==
Content-Type: multipart/alternative; boundary="000000000000a7dc520651348066"

--000000000000a7dc520651348066
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

It may be a simple overlook, or pretty old before we start using
ScmSmallInt.  Anyway, I updated the code so that bit indexes are all
ScmSmallInt.  This may require recompiling extensions if they use bits.h.

On Tue, May 5, 2026 at 3:46=E2=80=AFAM Jens Thiele <[email protected]> wrote:

> Jens Thiele <[email protected]> writes:
>
> > Hi,
> >
> > looks like there is some overflow in make-bitvector with sizes >=3D 2^3=
1 ?
>
> looks like bits.c assumes there are less than 2^31 bits (there int is
> used everywhere)
>
> especially:
> ScmBits *Scm_MakeBits(int numbits)
> and
> void Scm_BitsFill(ScmBits *bits, int start, int end, int b)
>
>
> _______________________________________________
> Gauche-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/gauche-devel
>

--000000000000a7dc520651348066
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div class=3D"gmail_default" style=3D"font-size:large">It =
may be a simple overlook, or pretty=C2=A0old before we start using ScmSmall=
Int.=C2=A0 Anyway, I updated the code so that bit indexes are all ScmSmallI=
nt.=C2=A0 This may require recompiling extensions if they use bits.h.</div>=
</div><br><div class=3D"gmail_quote gmail_quote_container"><div dir=3D"ltr"=
 class=3D"gmail_attr">On Tue, May 5, 2026 at 3:46=E2=80=AFAM Jens Thiele &l=
t;<a href=3D"mailto:[email protected]">[email protected]</a>&gt; wrote:<br></div>=
<blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-=
left:1px solid rgb(204,204,204);padding-left:1ex">Jens Thiele &lt;<a href=
=3D"mailto:[email protected]" target=3D"_blank">[email protected]</a>&gt; writes:=
<br>
<br>
&gt; Hi,<br>
&gt;<br>
&gt; looks like there is some overflow in make-bitvector with sizes &gt;=3D=
 2^31 ?<br>
<br>
looks like bits.c assumes there are less than 2^31 bits (there int is<br>
used everywhere)<br>
<br>
especially:<br>
ScmBits *Scm_MakeBits(int numbits)<br>
and<br>
void Scm_BitsFill(ScmBits *bits, int start, int end, int b)<br>
<br>
<br>
_______________________________________________<br>
Gauche-devel mailing list<br>
<a href=3D"mailto:[email protected]" target=3D"_blank">Gau=
[email protected]</a><br>
<a href=3D"https://lists.sourceforge.net/lists/listinfo/gauche-devel" rel=
=3D"noreferrer" target=3D"_blank">https://lists.sourceforge.net/lists/listi=
nfo/gauche-devel</a><br>
</blockquote></div>

--000000000000a7dc520651348066--


--===============4683823985235962007==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline


--===============4683823985235962007==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
Gauche-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/gauche-devel

--===============4683823985235962007==--