From: Josh Triplett <josht@linux.vnet.ibm.com>
To: David Given <dg@cowlark.com>
Cc: linux-sparse@vger.kernel.org
Subject: Re: Pointer arithmetic error
Date: Fri, 27 Jun 2008 17:29:37 -0700 [thread overview]
Message-ID: <1214612977.25532.14.camel@josh-work.beaverton.ibm.com> (raw)
In-Reply-To: <486578A9.7000900@cowlark.com>
On Sat, 2008-06-28 at 00:32 +0100, David Given wrote:
> diff --git a/compile-i386.c b/compile-i386.c
> index 8526408..3bbc9c7 100644
> --- a/compile-i386.c
> +++ b/compile-i386.c
> @@ -1584,7 +1584,7 @@ static struct storage *emit_select_expr(struct
> expression *expr)
> /*
> * Do the actual select: check the conditional for zero,
> * move false over true if zero
> - */
> + */
Don't include whitespace changes in unrelated patches. You have many
whitespace changes in this patch; I haven't commented on all of them.
> @@ -2040,7 +2040,7 @@ static struct symbol *evaluate_sizeof(struct
> expression *expr)
> if ((size < 0) || (size & 7))
> expression_error(expr, "cannot size expression");
This "size & 7" represents an assumption about bits_in_char as well; it
checks if the size represents an integral number of chars. You'll need
to look for other instances of 7 as well, to catch cases like this.
> @@ -2074,7 +2074,7 @@ static struct symbol *evaluate_ptrsizeof(struct
> expression *expr)
> if (size & 7)
> size = 0;
Same problem here.
> * storage for it..
> */
> hash = find_storage_hash(pseudo, state->outputs);
> @@ -1829,8 +1829,8 @@ static void set_up_arch_entry(struct entrypoint
> *ep, struct instruction *entry)
>
> in->type = REG_FRAME;
> in->offset = offset;
> -
> - offset += bits >> 3;
> +
> + offset += bits / bits_in_char;
The first line represents a whitespace-only change.
> --- a/target.c
> +++ b/target.c
> @@ -11,6 +11,8 @@ struct symbol *ssize_t_ctype = &int_ctype;
> */
> int max_alignment = 16;
>
> +int bits_in_unit = 8;
> +
Unused.
> @@ -483,7 +483,7 @@ static int escapechar(int first, int type,
> stream_t *stream, int *valp)
> int nr = 2;
> value -= '0';
> while (next >= '0' && next <= '9') {
> - value = (value << 3) + (next-'0');
> + value = (value*8) + (next-'0');
This does not relate to bits_per_char, and should not change.
- Josh Triplett
--
To unsubscribe from this list: send the line "unsubscribe linux-sparse" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2008-06-28 0:29 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-06-26 23:40 Pointer arithmetic error David Given
2008-06-26 23:51 ` Chris Li
2008-06-27 0:17 ` David Given
2008-06-27 9:00 ` Christopher Li
2008-06-27 9:49 ` Bernd Petrovitsch
2008-06-27 10:55 ` David Given
2008-06-27 11:20 ` Bernd Petrovitsch
2008-06-27 14:03 ` David Given
2008-06-27 14:45 ` Bernd Petrovitsch
2008-06-27 15:45 ` David Given
2008-06-27 18:01 ` Christopher Li
2008-06-27 23:32 ` David Given
2008-06-28 0:17 ` Christopher Li
2008-06-28 0:23 ` David Given
2008-06-29 0:10 ` David Given
2008-06-28 0:29 ` Josh Triplett [this message]
2008-06-29 0:13 ` Tommy Thorn
[not found] ` <48658B28.6010301@numba-tu.com>
2008-06-29 0:30 ` David Given
2008-06-29 0:38 ` Tommy Thorn
2008-06-29 12:19 ` Bernd Petrovitsch
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1214612977.25532.14.camel@josh-work.beaverton.ibm.com \
--to=josht@linux.vnet.ibm.com \
--cc=dg@cowlark.com \
--cc=linux-sparse@vger.kernel.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 NNTP newsgroup(s).