From: Al Viro <viro@ftp.linux.org.uk>
To: linux-sparse@vger.kernel.org
Subject: Sanitize pointer()
Date: Wed, 11 Mar 2009 07:08:35 +0000 [thread overview]
Message-ID: <E1LhIYN-00042T-DM@ZenIV.linux.org.uk> (raw)
There's no need to concat the context list into (empty) one of new node,
only to free the original one. Moving the pointer to list instead works
fine...
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
---
parse.c | 20 +++++---------------
1 files changed, 5 insertions(+), 15 deletions(-)
diff --git a/parse.c b/parse.c
index 28bc0c9..f16d321 100644
--- a/parse.c
+++ b/parse.c
@@ -1592,28 +1592,18 @@ static struct token *direct_declarator(struct token *token, struct decl_state *c
static struct token *pointer(struct token *token, struct decl_state *ctx)
{
- unsigned long modifiers;
- struct symbol *base_type;
-
- modifiers = ctx->ctype.modifiers;
- base_type = ctx->ctype.base_type;
-
while (match_op(token,'*')) {
struct symbol *ptr = alloc_symbol(token->pos, SYM_PTR);
- ptr->ctype.modifiers = modifiers;
+ ptr->ctype.modifiers = ctx->ctype.modifiers;
+ ptr->ctype.base_type = ctx->ctype.base_type;
ptr->ctype.as = ctx->ctype.as;
- concat_ptr_list((struct ptr_list *)ctx->ctype.contexts,
- (struct ptr_list **)&ptr->ctype.contexts);
- ptr->ctype.base_type = base_type;
reply other threads:[~2009-03-11 7:08 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=E1LhIYN-00042T-DM@ZenIV.linux.org.uk \
--to=viro@ftp.linux.org.uk \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.