unofficial mirror of bug-guile@gnu.org 
 help / color / mirror / Atom feed
From: Ian Price <ianprice90@googlemail.com>
To: Thien-Thi Nguyen <ttn@gnu.org>
Cc: 15370@debbugs.gnu.org
Subject: bug#15370: weirdness w/ uniform-vector-read! compat
Date: Sun, 20 Oct 2013 09:59:26 +0100	[thread overview]
Message-ID: <87r4bg1fo1.fsf@Kagami.home> (raw)
In-Reply-To: <874n9obu1n.fsf@zigzag.favinet> (Thien-Thi Nguyen's message of "Fri, 13 Sep 2013 17:49:56 +0200")

Thien-Thi Nguyen <ttn@gnu.org> writes:

> ERROR: In procedure uniform-vector-read!:
> ERROR: In procedure get-bytevector-n!: Value out of range: 4
>
> FWIW, Guile 1.8.8 produces same output as ‘ok’ on a similar (sans the
> ‘use-modules’ and ‘uniform-vector-element-size’ noise) input, so i think
> this situation is a regression.  Am i missing something?

You'll notice that if you supply the parameters directly
e.g. (uniform-vector-read! uve port 0 1), it succeeds. That's enough to
pin it down to the lines

  c_end = SCM_UNBNDP (end) ? SCM_BYTEVECTOR_LENGTH (uvec) : scm_to_size_t (end);
  c_end *= c_width;

in scm_uniform_vector_read_x in libguile/deprecated.c 

Bytevector length returns the number of bytes, but end specifies the
index. We should only be multiplying the latter, not the former. Simple
fix is to fold the multiplication into the else branch of the
conditional.

Since this procedure is marked deprecated, I'd like to know how long it
has left before I patch it. Little point fixing it if it's soon...

Cheers
-- 
Ian Price -- shift-reset.com

"Programming is like pinball. The reward for doing it well is
the opportunity to do it again" - from "The Wizardy Compiled"





  reply	other threads:[~2013-10-20  8:59 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-13 15:49 bug#15370: weirdness w/ uniform-vector-read! compat Thien-Thi Nguyen
2013-10-20  8:59 ` Ian Price [this message]
     [not found]   ` <87iowsfd9k.fsf@zigzag.favinet>
2013-10-20 14:36     ` Ian Price
2013-10-20 17:18   ` Mark H Weaver
2013-10-20 19:30     ` Ian Price

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/guile/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87r4bg1fo1.fsf@Kagami.home \
    --to=ianprice90@googlemail.com \
    --cc=15370@debbugs.gnu.org \
    --cc=ttn@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).