From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Sergei Trofimovich Newsgroups: gmane.lisp.guile.bugs Subject: bug#29162: [PATCH] fix scm_make_foreign_object_n Date: Wed, 22 Nov 2017 20:03:20 +0000 Message-ID: <20171122200320.23ad3f55@sf> References: <20171105221510.12760-1-slyfox@gentoo.org> <871skqz6sn.fsf@gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; boundary="Sig_/uZQ/WyYIRdOzFyVeT8G1tQL"; protocol="application/pgp-signature" X-Trace: blaine.gmane.org 1511381111 4366 195.159.176.226 (22 Nov 2017 20:05:11 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 22 Nov 2017 20:05:11 +0000 (UTC) Cc: 29162@debbugs.gnu.org To: ludo@gnu.org (Ludovic =?UTF-8?Q?Court=C3=A8s?=) Original-X-From: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Wed Nov 22 21:05:06 2017 Return-path: Envelope-to: guile-bugs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eHbGb-0000lk-Cf for guile-bugs@m.gmane.org; Wed, 22 Nov 2017 21:05:05 +0100 Original-Received: from localhost ([::1]:41137 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eHbGi-000650-97 for guile-bugs@m.gmane.org; Wed, 22 Nov 2017 15:05:12 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:48105) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eHbFf-0005ej-7J for bug-guile@gnu.org; Wed, 22 Nov 2017 15:04:08 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eHbFa-0005DP-TF for bug-guile@gnu.org; Wed, 22 Nov 2017 15:04:07 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:44422) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eHbFa-0005D2-Qb for bug-guile@gnu.org; Wed, 22 Nov 2017 15:04:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1eHbFa-0007kT-8l for bug-guile@gnu.org; Wed, 22 Nov 2017 15:04:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Sergei Trofimovich Original-Sender: "Debbugs-submit" Resent-CC: bug-guile@gnu.org Resent-Date: Wed, 22 Nov 2017 20:04:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 29162 X-GNU-PR-Package: guile X-GNU-PR-Keywords: patch Original-Received: via spool by 29162-submit@debbugs.gnu.org id=B29162.151138102529761 (code B ref 29162); Wed, 22 Nov 2017 20:04:02 +0000 Original-Received: (at 29162) by debbugs.gnu.org; 22 Nov 2017 20:03:45 +0000 Original-Received: from localhost ([127.0.0.1]:53103 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eHbFJ-0007jw-3u for submit@debbugs.gnu.org; Wed, 22 Nov 2017 15:03:45 -0500 Original-Received: from smtp.gentoo.org ([140.211.166.183]:37702) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eHbFH-0007jf-76 for 29162@debbugs.gnu.org; Wed, 22 Nov 2017 15:03:43 -0500 Original-Received: from sf (host81-147-9-225.range81-147.btcentralplus.com [81.147.9.225]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: slyfox) by smtp.gentoo.org (Postfix) with ESMTPSA id 49ECD33C770; Wed, 22 Nov 2017 20:03:36 +0000 (UTC) In-Reply-To: <871skqz6sn.fsf@gnu.org> X-Mailer: Claws Mail 3.15.1-dirty (GTK+ 2.24.31; x86_64-pc-linux-gnu) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-guile@gnu.org List-Id: "Bug reports for GUILE, GNU's Ubiquitous Extension Language" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Original-Sender: "bug-guile" Xref: news.gmane.org gmane.lisp.guile.bugs:8908 Archived-At: --Sig_/uZQ/WyYIRdOzFyVeT8G1tQL Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On Wed, 22 Nov 2017 16:12:24 +0100 ludo@gnu.org (Ludovic Court=C3=A8s) wrote: > Hi Sergei, >=20 > Sergei Trofimovich skribis: >=20 > > diff --git a/libguile/foreign-object.c b/libguile/foreign-object.c > > index 34b9f22ca..8fd2c384c 100644 > > --- a/libguile/foreign-object.c > > +++ b/libguile/foreign-object.c > > @@ -108,7 +108,7 @@ scm_make_foreign_object_n (SCM type, size_t n, void= *vals[]) > > =20 > > SCM_VALIDATE_VTABLE (SCM_ARG1, type); > > =20 > > - if (SCM_VTABLE_SIZE (type) / 2 < n) > > + if (SCM_VTABLE_SIZE (type) < n) > > scm_out_of_range (FUNC_NAME, scm_from_size_t (n)); =20 >=20 > Your analysis seems right, but the code in the current =E2=80=98stable-2.= 2=E2=80=99 > branch (which corresponds to the 2.2.x stable series) has different code > (correct code): >=20 > SCM_VALIDATE_VTABLE (SCM_ARG1, type); >=20 > layout =3D SCM_VTABLE_LAYOUT (type); >=20 > if (scm_i_symbol_length (layout) / 2 < n) > scm_out_of_range (FUNC_NAME, scm_from_size_t (n)); >=20 > What version were you looking at? It was the master branch of git://git.savannah.gnu.org/guile.git Commit from November: http://git.savannah.gnu.org/cgit/guile.git/commit/?id=3Df96a670332b2243= 26b89ce135a0edfb77a70c46e =20 The link with line number: http://git.savannah.gnu.org/cgit/guile.git/tree/libguile/foreign-object= .c?id=3Df96a670332b224326b89ce135a0edfb77a70c46e#n111 In master branch it still seems to be around: http://git.savannah.gnu.org/cgit/guile.git/tree/libguile/foreign-object= .c#n111 --=20 Sergei --Sig_/uZQ/WyYIRdOzFyVeT8G1tQL Content-Type: application/pgp-signature Content-Description: Цифровая подпись OpenPGP -----BEGIN PGP SIGNATURE----- iF0EARECAB0WIQSZKa0VG5avZRlY01hxoe52YR/zqgUCWhXYCAAKCRBxoe52YR/z qljyAJ42aiZoT4Mv3t6uVuTDWneA4dTfbQCeOHXTtACUpYmICrLg4TGgRKo9/EA= =rFOD -----END PGP SIGNATURE----- --Sig_/uZQ/WyYIRdOzFyVeT8G1tQL--