mbox series

[0/7,v2] libsepol/cil: Line mark cleanup and fix

Message ID 20210816195752.923028-1-jwcart2@gmail.com (mailing list archive)
Headers show
Series libsepol/cil: Line mark cleanup and fix | expand

Message

James Carter Aug. 16, 2021, 7:57 p.m. UTC
Patches 1-5 cleanup minor issues with CIL's line marks.

Patches 6-7 fix the way line mark works so that the correct line
numbers will be given for nested line marks.

Patch 8 writes out line mark information when writing out the AST.

Changes in v2
In patch 6, use cil_strpool_add("1") instead of "1"
In patch 7, fix confusing usage of pre_hll_expand and pre_hll_offset; initialize pre_hll_offset, change format specifiers in cil_tree.c to use %u instead of %d.

James Carter (7):
  libsepol/cil: Check syntax of src_info statement
  libsepol/cil: Check the token type after getting the next token
  libsepol/cil: Check for valid line mark type immediately
  libsepol/cil: Push line mark state first when processing a line mark
  libsepol/cil: Create common string-to-unsigned-integer functions
  libsepol/cil: Add line mark kind and line number to src info
  libsepol/cil: Report correct high-level language line numbers

 libsepol/cil/src/cil.c           |  70 ++++++++++++++++-
 libsepol/cil/src/cil_binary.c    |   9 ++-
 libsepol/cil/src/cil_build_ast.c |  77 ++++++++++--------
 libsepol/cil/src/cil_copy_ast.c  |   5 +-
 libsepol/cil/src/cil_internal.h  |   9 ++-
 libsepol/cil/src/cil_parser.c    | 129 +++++++++++++++----------------
 libsepol/cil/src/cil_tree.c      |  57 +++++++++-----
 libsepol/cil/src/cil_tree.h      |   4 +-
 8 files changed, 226 insertions(+), 134 deletions(-)

Comments

Nicolas Iooss Aug. 17, 2021, 7:34 p.m. UTC | #1
On Mon, Aug 16, 2021 at 9:57 PM James Carter <jwcart2@gmail.com> wrote:
>
> Patches 1-5 cleanup minor issues with CIL's line marks.
>
> Patches 6-7 fix the way line mark works so that the correct line
> numbers will be given for nested line marks.
>
> Patch 8 writes out line mark information when writing out the AST.

Hello,
Patch 8 is missing from the v2 (the series only contains 7 patches).
Should the previous patch 8 ("libsepol/cil: When writing AST use line
marks for src_info nodes") be also considered for review?

Thanks,
Nicolas

> Changes in v2
> In patch 6, use cil_strpool_add("1") instead of "1"
> In patch 7, fix confusing usage of pre_hll_expand and pre_hll_offset; initialize pre_hll_offset, change format specifiers in cil_tree.c to use %u instead of %d.
>
> James Carter (7):
>   libsepol/cil: Check syntax of src_info statement
>   libsepol/cil: Check the token type after getting the next token
>   libsepol/cil: Check for valid line mark type immediately
>   libsepol/cil: Push line mark state first when processing a line mark
>   libsepol/cil: Create common string-to-unsigned-integer functions
>   libsepol/cil: Add line mark kind and line number to src info
>   libsepol/cil: Report correct high-level language line numbers
>
>  libsepol/cil/src/cil.c           |  70 ++++++++++++++++-
>  libsepol/cil/src/cil_binary.c    |   9 ++-
>  libsepol/cil/src/cil_build_ast.c |  77 ++++++++++--------
>  libsepol/cil/src/cil_copy_ast.c  |   5 +-
>  libsepol/cil/src/cil_internal.h  |   9 ++-
>  libsepol/cil/src/cil_parser.c    | 129 +++++++++++++++----------------
>  libsepol/cil/src/cil_tree.c      |  57 +++++++++-----
>  libsepol/cil/src/cil_tree.h      |   4 +-
>  8 files changed, 226 insertions(+), 134 deletions(-)
>
> --
> 2.31.1
>
James Carter Aug. 17, 2021, 8:15 p.m. UTC | #2
On Tue, Aug 17, 2021 at 3:34 PM Nicolas Iooss <nicolas.iooss@m4x.org> wrote:
>
> On Mon, Aug 16, 2021 at 9:57 PM James Carter <jwcart2@gmail.com> wrote:
> >
> > Patches 1-5 cleanup minor issues with CIL's line marks.
> >
> > Patches 6-7 fix the way line mark works so that the correct line
> > numbers will be given for nested line marks.
> >
> > Patch 8 writes out line mark information when writing out the AST.
>
> Hello,
> Patch 8 is missing from the v2 (the series only contains 7 patches).
> Should the previous patch 8 ("libsepol/cil: When writing AST use line
> marks for src_info nodes") be also considered for review?
>

Yes, I got caught up in correcting patch 7 that I never applied patch
8 when updating. There are no changes to that patch.
Thanks,
Jim

> Thanks,
> Nicolas
>
> > Changes in v2
> > In patch 6, use cil_strpool_add("1") instead of "1"
> > In patch 7, fix confusing usage of pre_hll_expand and pre_hll_offset; initialize pre_hll_offset, change format specifiers in cil_tree.c to use %u instead of %d.
> >
> > James Carter (7):
> >   libsepol/cil: Check syntax of src_info statement
> >   libsepol/cil: Check the token type after getting the next token
> >   libsepol/cil: Check for valid line mark type immediately
> >   libsepol/cil: Push line mark state first when processing a line mark
> >   libsepol/cil: Create common string-to-unsigned-integer functions
> >   libsepol/cil: Add line mark kind and line number to src info
> >   libsepol/cil: Report correct high-level language line numbers
> >
> >  libsepol/cil/src/cil.c           |  70 ++++++++++++++++-
> >  libsepol/cil/src/cil_binary.c    |   9 ++-
> >  libsepol/cil/src/cil_build_ast.c |  77 ++++++++++--------
> >  libsepol/cil/src/cil_copy_ast.c  |   5 +-
> >  libsepol/cil/src/cil_internal.h  |   9 ++-
> >  libsepol/cil/src/cil_parser.c    | 129 +++++++++++++++----------------
> >  libsepol/cil/src/cil_tree.c      |  57 +++++++++-----
> >  libsepol/cil/src/cil_tree.h      |   4 +-
> >  8 files changed, 226 insertions(+), 134 deletions(-)
> >
> > --
> > 2.31.1
> >
>
Nicolas Iooss Aug. 17, 2021, 8:43 p.m. UTC | #3
On Tue, Aug 17, 2021 at 10:15 PM James Carter <jwcart2@gmail.com> wrote:
>
> On Tue, Aug 17, 2021 at 3:34 PM Nicolas Iooss <nicolas.iooss@m4x.org> wrote:
> >
> > On Mon, Aug 16, 2021 at 9:57 PM James Carter <jwcart2@gmail.com> wrote:
> > >
> > > Patches 1-5 cleanup minor issues with CIL's line marks.
> > >
> > > Patches 6-7 fix the way line mark works so that the correct line
> > > numbers will be given for nested line marks.
> > >
> > > Patch 8 writes out line mark information when writing out the AST.
> >
> > Hello,
> > Patch 8 is missing from the v2 (the series only contains 7 patches).
> > Should the previous patch 8 ("libsepol/cil: When writing AST use line
> > marks for src_info nodes") be also considered for review?
> >
>
> Yes, I got caught up in correcting patch 7 that I never applied patch
> 8 when updating. There are no changes to that patch.
> Thanks,
> Jim

OK. For all 8 patches:

Acked-by: Nicolas Iooss <nicolas.iooss@m4x.org>

Thanks,
Nicolas

> > > Changes in v2
> > > In patch 6, use cil_strpool_add("1") instead of "1"
> > > In patch 7, fix confusing usage of pre_hll_expand and pre_hll_offset; initialize pre_hll_offset, change format specifiers in cil_tree.c to use %u instead of %d.
> > >
> > > James Carter (7):
> > >   libsepol/cil: Check syntax of src_info statement
> > >   libsepol/cil: Check the token type after getting the next token
> > >   libsepol/cil: Check for valid line mark type immediately
> > >   libsepol/cil: Push line mark state first when processing a line mark
> > >   libsepol/cil: Create common string-to-unsigned-integer functions
> > >   libsepol/cil: Add line mark kind and line number to src info
> > >   libsepol/cil: Report correct high-level language line numbers
> > >
> > >  libsepol/cil/src/cil.c           |  70 ++++++++++++++++-
> > >  libsepol/cil/src/cil_binary.c    |   9 ++-
> > >  libsepol/cil/src/cil_build_ast.c |  77 ++++++++++--------
> > >  libsepol/cil/src/cil_copy_ast.c  |   5 +-
> > >  libsepol/cil/src/cil_internal.h  |   9 ++-
> > >  libsepol/cil/src/cil_parser.c    | 129 +++++++++++++++----------------
> > >  libsepol/cil/src/cil_tree.c      |  57 +++++++++-----
> > >  libsepol/cil/src/cil_tree.h      |   4 +-
> > >  8 files changed, 226 insertions(+), 134 deletions(-)
> > >
> > > --
> > > 2.31.1
> > >
> >
James Carter Aug. 19, 2021, 7:20 p.m. UTC | #4
On Tue, Aug 17, 2021 at 4:43 PM Nicolas Iooss <nicolas.iooss@m4x.org> wrote:
>
> On Tue, Aug 17, 2021 at 10:15 PM James Carter <jwcart2@gmail.com> wrote:
> >
> > On Tue, Aug 17, 2021 at 3:34 PM Nicolas Iooss <nicolas.iooss@m4x.org> wrote:
> > >
> > > On Mon, Aug 16, 2021 at 9:57 PM James Carter <jwcart2@gmail.com> wrote:
> > > >
> > > > Patches 1-5 cleanup minor issues with CIL's line marks.
> > > >
> > > > Patches 6-7 fix the way line mark works so that the correct line
> > > > numbers will be given for nested line marks.
> > > >
> > > > Patch 8 writes out line mark information when writing out the AST.
> > >
> > > Hello,
> > > Patch 8 is missing from the v2 (the series only contains 7 patches).
> > > Should the previous patch 8 ("libsepol/cil: When writing AST use line
> > > marks for src_info nodes") be also considered for review?
> > >
> >
> > Yes, I got caught up in correcting patch 7 that I never applied patch
> > 8 when updating. There are no changes to that patch.
> > Thanks,
> > Jim
>
> OK. For all 8 patches:
>
> Acked-by: Nicolas Iooss <nicolas.iooss@m4x.org>
>

Merged.
Thanks,
Jim

> Thanks,
> Nicolas
>
> > > > Changes in v2
> > > > In patch 6, use cil_strpool_add("1") instead of "1"
> > > > In patch 7, fix confusing usage of pre_hll_expand and pre_hll_offset; initialize pre_hll_offset, change format specifiers in cil_tree.c to use %u instead of %d.
> > > >
> > > > James Carter (7):
> > > >   libsepol/cil: Check syntax of src_info statement
> > > >   libsepol/cil: Check the token type after getting the next token
> > > >   libsepol/cil: Check for valid line mark type immediately
> > > >   libsepol/cil: Push line mark state first when processing a line mark
> > > >   libsepol/cil: Create common string-to-unsigned-integer functions
> > > >   libsepol/cil: Add line mark kind and line number to src info
> > > >   libsepol/cil: Report correct high-level language line numbers
> > > >
> > > >  libsepol/cil/src/cil.c           |  70 ++++++++++++++++-
> > > >  libsepol/cil/src/cil_binary.c    |   9 ++-
> > > >  libsepol/cil/src/cil_build_ast.c |  77 ++++++++++--------
> > > >  libsepol/cil/src/cil_copy_ast.c  |   5 +-
> > > >  libsepol/cil/src/cil_internal.h  |   9 ++-
> > > >  libsepol/cil/src/cil_parser.c    | 129 +++++++++++++++----------------
> > > >  libsepol/cil/src/cil_tree.c      |  57 +++++++++-----
> > > >  libsepol/cil/src/cil_tree.h      |   4 +-
> > > >  8 files changed, 226 insertions(+), 134 deletions(-)
> > > >
> > > > --
> > > > 2.31.1
> > > >
> > >
>