From: Cyril Hrubis <chrubis@suse.cz>
To: Richard Palethorpe <rpalethorpe@suse.com>
Cc: ltp@lists.linux.it
Subject: Re: [LTP] [PATCH v2 2/3] check: Add LTP-005 null termination check on test.tags
Date: Tue, 7 Dec 2021 11:54:08 +0100 [thread overview]
Message-ID: <Ya89UIlBL8kBaZDP@yuki> (raw)
In-Reply-To: <20211207102904.6011-2-rpalethorpe@suse.com>
Hi!
> +/* Checks if some struct array initializer is terminated with a blank
> + * (zeroed) item i.e. {}
> + */
> +static bool is_terminated_with_null_struct(const struct symbol *const sym)
> +{
> + const struct expression *const arr_init = sym->initializer;
> + const struct expression *item_init =
> + last_ptr_list((struct ptr_list *)arr_init->expr_list);
> +
> + if (item_init->type == EXPR_POS)
> + item_init = item_init->init_expr;
> +
> + return ptr_list_empty((struct ptr_list *)item_init->expr_list);
> +}
Looks good now.
--
Cyril Hrubis
chrubis@suse.cz
--
Mailing list info: https://lists.linux.it/listinfo/ltp
next prev parent reply other threads:[~2021-12-07 10:53 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-12-07 10:29 [LTP] [PATCH v2 1/3] doc: Add LTP-005: Array must be sentinel terminated Richard Palethorpe via ltp
2021-12-07 10:29 ` [LTP] [PATCH v2 2/3] check: Add LTP-005 null termination check on test.tags Richard Palethorpe via ltp
2021-12-07 10:54 ` Cyril Hrubis [this message]
2021-12-07 10:29 ` [LTP] [PATCH v2 3/3] getrusage03, setsockopt03: Add sentinel value to tags Richard Palethorpe via ltp
2021-12-07 10:55 ` Cyril Hrubis
2021-12-07 11:31 ` Richard Palethorpe
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=Ya89UIlBL8kBaZDP@yuki \
--to=chrubis@suse.cz \
--cc=ltp@lists.linux.it \
--cc=rpalethorpe@suse.com \
/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