]> sourceware.org Git - libabigail.git/commit
Bug 18894 - Fix representation of enumerators in abixml format
authorDodji Seketeli <dodji@redhat.com>
Sat, 29 Aug 2015 15:17:48 +0000 (17:17 +0200)
committerDodji Seketeli <dodji@redhat.com>
Sat, 29 Aug 2015 15:17:48 +0000 (17:17 +0200)
commit5822798dd1e2163d55cac9b9b72f0eacb21fb718
treeade865021e6ece4017230a2dbd1071279252229c
parent425f8a4ec4fd5a1b2784927d0edc06e6384d5d2e
Bug 18894 - Fix representation of enumerators in abixml format

It turns out that using a size_t to serialize an enumerator is not
enough to represent things like enum foo {value = -3}; We need to
represent it using ssize_t.

Also, the patch avoids early canonicalization (when reading DWARF) of
types that refer to themselves.  This was leading to type degradation
(serializing the type from IR to abixml and de-serializing it back to
IR leads to a different type).

* include/abg-ir.h (enum_type_decl::enumerator::get_value()):
Change the type of this from size_t to ssize_t.
* src/abg-ir.cc (enum_type_decl::enumerator::get_value): Do the
same on the definition side.
(non_canonicalized_subtype_detector::visit_begin): If a type
refers to itself, late canonicalize it to have a similar hashing
result as what the abixml reader does.
* src/abg-reader.cc (build_enum_type_decl): Use ssize_t to read
the value of enumerators.
* tests/data/test-read-dwarf/test13-pr18894.so.abi: New test input.
* tests/data/Makefile.am: Add the new test inputs above to source
distribution.
* tests/test-read-dwarf.cc (in_out_specs): Add new test inputs.
* tests/data/test-read-dwarf/test9-pr18818-clang.so.abi: Adjust.
* tests/data/test-read-dwarf/test10-pr18818-gcc.so.abi: Likewise.
* tests/data/test-read-dwarf/test11-pr18828.so.abi: Likewise.
* tests/data/test-read-dwarf/test12-pr18844.so.abi: Likewise.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
include/abg-ir.h
src/abg-ir.cc
src/abg-reader.cc
tests/data/Makefile.am
tests/data/test-read-dwarf/test10-pr18818-gcc.so.abi
tests/data/test-read-dwarf/test11-pr18828.so.abi
tests/data/test-read-dwarf/test12-pr18844.so.abi
tests/data/test-read-dwarf/test13-pr18894.so [new file with mode: 0644]
tests/data/test-read-dwarf/test13-pr18894.so.abi [new file with mode: 0644]
tests/data/test-read-dwarf/test9-pr18818-clang.so.abi
tests/test-read-dwarf.cc
This page took 0.033824 seconds and 5 git commands to generate.