[applied] ini: Support '[' and ']' in arguments of function call expressions
Commit Message
Hello,
Consider the suppression specification below:
[suppress_type]
type_kind = struct
has_data_member_inserted_at = offset_of_first_data_member_regexp(.*p[0-9]?$)
The parser wrongly considers that in the regular expression
".*p[0-9]?$", the characters '[' and ']' should be escaped. Fixed
thus.
* src/abg-ini.cc (char_is_function_name_char): The only delimiters
should be the '(' and ')' characters.
* tests/data/test-diff-suppr/test-has-data-member-inserted-at-1-report-2.txt:
New reference test output.
* tests/data/test-diff-suppr/test-has-data-member-inserted-at-1.2.suppr:
New suppression specification.
* tests/data/Makefile.am: Add the new test material above to
source distribution.
* tests/test-diff-suppr.cc (in_out_specs): Add the new test
material above to this test harness.
Signed-off-by: Dodji Seketeli <dodji@redhat.com>
Applied to master
---
src/abg-ini.cc | 2 +-
tests/data/Makefile.am | 2 ++
.../test-has-data-member-inserted-at-1-report-2.txt | 4 ++++
.../test-has-data-member-inserted-at-1.2.suppr | 3 +++
tests/test-diff-suppr.cc | 10 ++++++++++
5 files changed, 20 insertions(+), 1 deletion(-)
create mode 100644 tests/data/test-diff-suppr/test-has-data-member-inserted-at-1-report-2.txt
create mode 100644 tests/data/test-diff-suppr/test-has-data-member-inserted-at-1.2.suppr
@@ -145,7 +145,7 @@ char_is_function_name_char(int b)
static bool
char_is_function_argument_char(int b)
{
- if (char_is_delimiter(b) || b == '(' || b == ')')
+ if (b == '(' || b == ')')
return false;
return true;
}
@@ -1893,6 +1893,8 @@ test-diff-dwarf-abixml/test0-pr19026-libvtkIOSQL-6.1.so.1-report-0.txt \
test-diff-dwarf-abixml/PR25409-librte_bus_dpaa.so.20.0 \
test-diff-dwarf-abixml/PR25409-librte_bus_dpaa.so.20.0.abi \
test-diff-dwarf-abixml/PR25409-librte_bus_dpaa.so.20.0-report-0.txt \
+test-diff-suppr/test-has-data-member-inserted-at-1-report-2.txt \
+test-diff-suppr/test-has-data-member-inserted-at-1.2.suppr \
\
test-lookup-syms/test0.cc \
test-lookup-syms/test0.o \
new file mode 100644
@@ -0,0 +1,4 @@
+Functions changes summary: 0 Removed, 0 Changed, 0 Added function
+Variables changes summary: 0 Removed, 0 Changed, 0 Added variable
+Unreachable types summary: 0 removed, 0 changed (1 filtered out), 0 added type
+
new file mode 100644
@@ -0,0 +1,3 @@
+[suppress_type]
+ type_kind = struct
+ has_data_member_inserted_at = offset_of_first_data_member_regexp(.*p[0-9]?$)
@@ -2266,6 +2266,16 @@ InOutSpec in_out_specs[] =
"data/test-diff-suppr/test-has-data-member-inserted-at-1-report-1.txt",
"output/test-diff-suppr/test-has-data-member-inserted-at-1-report-1.txt"
},
+ {
+ "data/test-diff-suppr/test-has-data-member-inserted-at-1-v0.o",
+ "data/test-diff-suppr/test-has-data-member-inserted-at-1-v1.o",
+ "",
+ "",
+ "data/test-diff-suppr/test-has-data-member-inserted-at-1.2.suppr",
+ "--drop-private-types --no-default-suppression --non-reachable-types",
+ "data/test-diff-suppr/test-has-data-member-inserted-at-1-report-2.txt",
+ "output/test-diff-suppr/test-has-data-member-inserted-at-1-report-2.txt"
+ },
// This should be the last entry
{NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL}
};