On Tue, Apr 28, 2020 at 08:41:08PM +0200, Julia Lawall wrote:
>
>
> On Tue, 28 Apr 2020, Paul Chaignon wrote:
>
> > Thanks for the quick answer!
> >
> > On Tue, Apr 28, 2020 at 07:44:15PM +0200, Julia Lawall wrote:
> > >
> > >
> > > On Tue, 28 Apr 2020, Paul Chaignon wrote:
> > >
> > > > Hi
On Tue, 28 Apr 2020, Paul Chaignon wrote:
> Thanks for the quick answer!
>
> On Tue, Apr 28, 2020 at 07:44:15PM +0200, Julia Lawall wrote:
> >
> >
> > On Tue, 28 Apr 2020, Paul Chaignon wrote:
> >
> > > Hi all,
> > >
> > > I am working on a small semantic patch to annotate specific variables
Thanks for the quick answer!
On Tue, Apr 28, 2020 at 07:44:15PM +0200, Julia Lawall wrote:
>
>
> On Tue, 28 Apr 2020, Paul Chaignon wrote:
>
> > Hi all,
> >
> > I am working on a small semantic patch to annotate specific variables in
> > our codebase with __attribute__((aligned(8))). The
On Tue, 28 Apr 2020, Paul Chaignon wrote:
> Hi all,
>
> I am working on a small semantic patch to annotate specific variables in
> our codebase with __attribute__((aligned(8))). The following program works
> fine.
>
> @r@
> expression e1, e2;
> identifier x;
> @@
> (
> struct
On Thu, Apr 23, 2020 at 05:23:29PM +0200, Markus Elfring wrote:
> >> https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/log/scripts/coccinelle/free/iounmap.cocci
> >>
> >> How do you think about to extend presented software analysis approaches?
> >>
> > Sorry, I am not familiar
On Thu, Apr 23, 2020 at 01:10:14PM +0200, Markus Elfring wrote:
> > if do_take_over_console() return an error in the newport_probe(),
> > due to the io virtual address is not released, it will cause a leak.
>
> How do you think about a wording variant like the following?
>
>Subject:
>
Hi all,
I am working on a small semantic patch to annotate specific variables in
our codebase with __attribute__((aligned(8))). The following program works
fine.
@r@
expression e1, e2;
identifier x;
@@
(
struct \(icmphdr\|icmp6hdr\) x
+ __attribute__((aligned(8)))
;
|
Add cast attributes to AST0 of SmPL. This is a list of attributes in the
Cast type of AST0.
Signed-off-by: Jaskaran Singh
---
parsing_cocci/ast0_cocci.ml | 4 ++--
parsing_cocci/ast0_cocci.mli | 4 ++--
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/parsing_cocci/ast0_cocci.ml
Cast attributes are added to the SmPL AST. Reflect these changes in
check_exhaustive_pattern.ml.
Signed-off-by: Jaskaran Singh
---
engine/check_exhaustive_pattern.ml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/engine/check_exhaustive_pattern.ml
Add a test case to check allminus for cast attributes. The test case
replaces all the cast types in the C program. Cases covered are for when
the attribute is:
- Before the cast type.
- After the cast type.
- After the cast type and before the *.
- After the cast type and *.
Signed-off-by:
Add a test case to detect a cast attribute. The following cases are
covered for when a attribute is:
- Before the cast type.
- After the cast type.
- After the cast type and before the *.
- After the cast type and *.
Signed-off-by: Jaskaran Singh
---
tests/detect_cast_attr.c | 10
Add a test case to remove a cast attribute. The following cases are
covered for when a attribute is:
- Before the cast type.
- After the cast type.
- After the cast type and before the *.
- After the cast type and *.
Signed-off-by: Jaskaran Singh
---
tests/remove_cast_attr.c | 10
Cast attributes are added to the C and SmPL ASTs. Reflect these changes
in coccilib.mli.
Signed-off-by: Jaskaran Singh
---
ocaml/coccilib.mli | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/ocaml/coccilib.mli b/ocaml/coccilib.mli
index a305d616..0c379547 100644
---
Cast attributes are added to the SmPL AST. Reflect these changes in
unparse_ast0.ml.
Signed-off-by: Jaskaran Singh
---
parsing_cocci/unparse_ast0.ml | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/parsing_cocci/unparse_ast0.ml b/parsing_cocci/unparse_ast0.ml
index
Cast attributes are added to the C and SmPL ASTs. Match these attributes
in cocci_vs_c.ml.
Signed-off-by: Jaskaran Singh
---
engine/cocci_vs_c.ml | 24 +---
1 file changed, 17 insertions(+), 7 deletions(-)
diff --git a/engine/cocci_vs_c.ml b/engine/cocci_vs_c.ml
index
Cast attributes are added to the SmPL AST. Reflect these changes in
unparse_cocci.ml.
Signed-off-by: Jaskaran Singh
---
parsing_c/unparse_cocci.ml | 6 --
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/parsing_c/unparse_cocci.ml b/parsing_c/unparse_cocci.ml
index
Cast attributes are added to the C AST. Visit these attributes in
the C AST visitor.
Signed-off-by: Jaskaran Singh
---
parsing_c/visitor_c.ml | 10 --
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/parsing_c/visitor_c.ml b/parsing_c/visitor_c.ml
index 57b5f32b..1a522413
Cast attributes are added to the SmPL AST. Reflect these changes in
position_generator.ml.
Signed-off-by: Jaskaran Singh
---
tools/spgen/source/position_generator.ml | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/tools/spgen/source/position_generator.ml
Cast attributes are added to the SmPL AST. Reflect these changes in
type_annoter_c.ml.
Signed-off-by: Jaskaran Singh
---
parsing_c/type_annoter_c.ml | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/parsing_c/type_annoter_c.ml b/parsing_c/type_annoter_c.ml
index
Add cast attributes to the SmPL AST. This is a list of attributes in the
Cast type of the SmPL AST.
Signed-off-by: Jaskaran Singh
---
parsing_cocci/ast_cocci.ml | 4 ++--
parsing_cocci/ast_cocci.mli | 4 ++--
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git
Cast attributes are added to AST0 of SmPL. Visit these attributes in the
SmPL AST visitor.
Signed-off-by: Jaskaran Singh
---
parsing_cocci/visitor_ast.ml | 10 ++
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/parsing_cocci/visitor_ast.ml b/parsing_cocci/visitor_ast.ml
Cast attributes are added to the SmPL AST. Reflect these changes in
disjdistr.ml.
Signed-off-by: Jaskaran Singh
---
parsing_cocci/disjdistr.ml | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/parsing_cocci/disjdistr.ml b/parsing_cocci/disjdistr.ml
index
Cast attributes are added to the SmPL AST. Reflect these changes in
single_statement.ml.
Signed-off-by: Jaskaran Singh
---
parsing_cocci/single_statement.ml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/parsing_cocci/single_statement.ml
b/parsing_cocci/single_statement.ml
Cast attributes are added to the SmPL AST. Print these attributes in
pretty_print_c.ml.
Signed-off-by: Jaskaran Singh
---
parsing_c/pretty_print_c.ml | 7 ---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/parsing_c/pretty_print_c.ml b/parsing_c/pretty_print_c.ml
index
Cast attributes are added to the SmPL AST. Reflect these changes in
unify_ast.ml.
Signed-off-by: Jaskaran Singh
---
parsing_cocci/unify_ast.ml | 6 --
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/parsing_cocci/unify_ast.ml b/parsing_cocci/unify_ast.ml
index
Cast attributes are added to the SmPL AST. Reflect these changes in
pretty_print_cocci.ml by printing these attributes.
Signed-off-by: Jaskaran Singh
---
parsing_cocci/pretty_print_cocci.ml | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git
Cast attributes are added to the C AST. Parse cast attributes in the C
parser and place them in the C AST. The attributes are taken from the
type_name rule of the C parser.
Signed-off-by: Jaskaran Singh
---
parsing_c/parser_c.mly | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff
Add cast attributes to the C AST. This is a list of attributes in the
Cast type of the C AST.
Signed-off-by: Jaskaran Singh
---
parsing_c/ast_c.ml | 2 +-
parsing_c/ast_c.mli | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/parsing_c/ast_c.ml b/parsing_c/ast_c.ml
index
Cast attributes are added to the SmPL AST. Reflect these changes in
ast0toast.ml.
Signed-off-by: Jaskaran Singh
---
parsing_cocci/ast0toast.ml | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/parsing_cocci/ast0toast.ml b/parsing_cocci/ast0toast.ml
index
Cast attributes are added to the SmPL AST. Reflect these changes in
index.ml.
Signed-off-by: Jaskaran Singh
---
parsing_cocci/index.ml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/parsing_cocci/index.ml b/parsing_cocci/index.ml
index f7ae48b4..a3b92c12 100644
---
This patch series aims to add cast attributes to the C and SmPL ASTs, and
match them in C source code. This is a continuation of the series "cocci:
Improve C parsing of attributes"[1].
Three test cases are included:
- detect_cast_attr: Test case to detect a parameter attribute.
-
Cast attributes are added to the SmPL AST. Reflect these changes in
arity.ml.
Signed-off-by: Jaskaran Singh
---
parsing_cocci/arity.ml | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/parsing_cocci/arity.ml b/parsing_cocci/arity.ml
index 8ee6d33f..880cd7a3 100644
---
To add Cast attributes to the C AST, pass attributes from the type_name
rule of the C parser.
Signed-off-by: Jaskaran Singh
---
ocaml/coccilib.mli | 3 ++-
parsing_c/parse_c.ml | 4 +++-
parsing_c/parser_c.mly | 16
3 files changed, 13 insertions(+), 10 deletions(-)
Cast attributes are added to the SmPL ASTs. Parse these attributes in
the SmPL parser and place them in the SmPL AST. The added production
only supports attributes after the type and before the expression.
Signed-off-by: Jaskaran Singh
---
parsing_cocci/parser_cocci_menhir.mly | 9 +
1
Cast attributes are added to the SmPL AST. Reflect these changes in
check_meta.ml.
Signed-off-by: Jaskaran Singh
---
parsing_cocci/check_meta.ml | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/parsing_cocci/check_meta.ml b/parsing_cocci/check_meta.ml
index
Cast attributes are added to the SmPL AST. Reflect these changes in
context_neg.ml.
Signed-off-by: Jaskaran Singh
---
parsing_cocci/context_neg.ml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/parsing_cocci/context_neg.ml b/parsing_cocci/context_neg.ml
index
Cast attributes are added to the SmPL AST. Reflect these changes in
compute_lines.ml.
Signed-off-by: Jaskaran Singh
---
parsing_cocci/compute_lines.ml | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/parsing_cocci/compute_lines.ml b/parsing_cocci/compute_lines.ml
index
Cast attributes are added to AST0 of SmPL. Visit these attributes in the
AST0 visitor of SmPL.
Signed-off-by: Jaskaran Singh
---
parsing_cocci/visitor_ast0.ml | 6 --
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/parsing_cocci/visitor_ast0.ml b/parsing_cocci/visitor_ast0.ml
Cast attributes are added to the SmPL AST. Reflect these changes in
iso_pattern.ml.
Signed-off-by: Jaskaran Singh
---
parsing_cocci/iso_pattern.ml | 12 +---
1 file changed, 9 insertions(+), 3 deletions(-)
diff --git a/parsing_cocci/iso_pattern.ml b/parsing_cocci/iso_pattern.ml
index
Cast attributes are added to the SmPL AST. Reflect these changes in
type_infer.ml.
Signed-off-by: Jaskaran Singh
---
parsing_cocci/type_infer.ml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/parsing_cocci/type_infer.ml b/parsing_cocci/type_infer.ml
index e8aad810..2c1cc73b
On Mon, 2020-04-27 at 19:31 +0200, Julia Lawall wrote:
>
> On Mon, 27 Apr 2020, Jaskaran Singh wrote:
>
> > Add a test case for removing Parameter attributes. The test case
> > checks
> > correct removal of the attribute when it is:
> >
> > - before the parameter type.
> > - after the parameter
41 matches
Mail list logo