From bd1d16c3a17c227d1379df10e97f6c7865ad1440 Mon Sep 17 00:00:00 2001 From: Petr Machata Date: Wed, 16 Mar 2011 18:16:12 +0100 Subject: [PATCH] Handle repeated requests for invalid abbreviation --- libdw/dwarf_tag.c | 5 +++++ tests/Makefile.am | 2 +- tests/run-rerequest_tag.sh | 3 ++- tests/testfile57.bz2 | Bin 0 -> 593 bytes 4 files changed, 8 insertions(+), 2 deletions(-) create mode 100644 tests/testfile57.bz2 diff --git a/libdw/dwarf_tag.c b/libdw/dwarf_tag.c index 6d9090c..fa8b384 100644 --- a/libdw/dwarf_tag.c +++ b/libdw/dwarf_tag.c @@ -90,6 +90,11 @@ __libdw_findabbrev (struct Dwarf_CU *cu, unsigned int code) break; } + /* This is our second (or third, etc.) call to __libdw_findabbrev + and the code is invalid. */ + if (unlikely (abb == NULL)) + abb = DWARF_END_ABBREV; + return abb; } diff --git a/tests/Makefile.am b/tests/Makefile.am index 32a15e2..70029f7 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -157,7 +157,7 @@ EXTRA_DIST = run-arextract.sh run-arsymtest.sh \ testfile55-32.bz2 testfile55-32.debug.bz2 \ testfile55-32.prelink.bz2 testfile55-64.bz2 \ testfile55-64.debug.bz2 testfile55-64.prelink.bz2 \ - testfile56.bz2 + testfile56.bz2 testfile57.bz2 installed_TESTS_ENVIRONMENT = libdir=$(DESTDIR)$(libdir) \ bindir=$(DESTDIR)$(bindir) \ diff --git a/tests/run-rerequest_tag.sh b/tests/run-rerequest_tag.sh index 1636fbf..c61a9fd 100755 --- a/tests/run-rerequest_tag.sh +++ b/tests/run-rerequest_tag.sh @@ -25,8 +25,9 @@ . $srcdir/test-subr.sh -testfiles testfile56 +testfiles testfile56 testfile57 testrun ./rerequest_tag testfile56 +testrun ./rerequest_tag testfile57 exit 0 diff --git a/tests/testfile57.bz2 b/tests/testfile57.bz2 new file mode 100644 index 0000000000000000000000000000000000000000..59dbde109af96a01797c50373ff532e6c79fd785 GIT binary patch literal 593 zcmV-X0Df zSWddNf}m)?N>ZE2sMH{bsCwrtHtl!y&a3dDV1axqo$PBuM7_~wbSb$srP%aL@>)VO z*;5iIJT{RG7j=mi+7b`*^)PHI$$&0jgF&Kg1;!A?>}dosw3|TK*z{orD+on`LJ%V% z;dSY*x|!?>BthaLA95yL?wVo%ztqY|U`7*+i)2a|vZ;#X6nTS_Z5SWDhO1eOSeDU& zk`fwaPqg7XWkJaxc**<~V`&~#{gq>)p*Nn4b_ zdvGL{p_=MW2GkaY#kykW$boHSMrTP34<*Q24%i9;qu{>4!Kt$21w+h{^jC(9C;=uv1uUQz zW(fhe1!Meh35H^Ljcs27Zg$xH$>4_-@Yh7r#Fj*3lh|Z#GUHf%vjk~QypbFPxl1t_ fO(+Cz!kMHY0Kwy1C`58u!Tv7fig2MIYxyG