Skip to content

Instantly share code, notes, and snippets.

@kylemanna
Last active August 29, 2015 14:23
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kylemanna/7d4007a2c18c62a1d84d to your computer and use it in GitHub Desktop.
Save kylemanna/7d4007a2c18c62a1d84d to your computer and use it in GitHub Desktop.
#!/bin/bash
#
# Git bisect script to find the source of demangle issues
#
# $ git bisect start binutils-2_25 binutils-2_24 libiberty
# $ git bisect run ./git-bisect-libiberty.sh
#
ret=0
set -ex
cd libiberty
./configure
make clean && make
cd testsuite
make test-demangle
cat <<EOF >> demangle-expected
# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65732
--format=gnu-v3 --no-params
_ZNK7VectorTIfEmlIfvEES_IDTmlcvf_EcvT__EEERKS2_
VectorT<decltype (((float)())*((float)()))> VectorT<float>::operator*<float, void>(float const&) const
VectorT<float>::operator*<float, void>
EOF
./test-demangle < demangle-expected || ret=1
git checkout demangle-expected
exit $ret
492e19d098f4bf4f22bac22815e9cb117be55b33 is the first bad commit
commit 492e19d098f4bf4f22bac22815e9cb117be55b33
Author: ccoutant <ccoutant@138bc75d-0d04-0410-961f-82ee72b054a4>
Date: Fri Nov 22 22:25:49 2013 +0000
Fix demangler to handle conversion operators correctly.
libiberty/
PR other/59195
* cp-demangle.c (struct d_info_checkpoint): New struct.
(struct d_print_info): Add current_template field.
(d_operator_name): Set flag when processing a conversion
operator.
(cplus_demangle_type): When processing <template-args> for
a conversion operator, backtrack if necessary.
(d_expression_1): Renamed from d_expression.
(d_expression): New wrapper around d_expression_1.
(d_checkpoint): New function.
(d_backtrack): New function.
(d_print_init): Initialize current_template.
(d_print_comp): Set current_template.
(d_print_cast): Put current_template in scope for
printing conversion operator name.
(cplus_demangle_init_info): Initialize is_expression and
is_conversion.
* cp-demangle.h (struct d_info): Add is_expression and
is_conversion fields.
* testsuite/demangle-expected: New test cases.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@205292 138bc75d-0d04-0410-961f-82ee72b054a4
:040000 040000 89c323af64e1397e1d3ccc5e815ade220a39724d 232438ed91649e8add143213b5922edb7000e423 M libiberty
bisect run success
@kylemanna
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment