Skip to content

Commit f7596ec

Browse files
committedOct 20, 2017
GNU: do not read the FDE count if omitted
If there is no binary search table computed, the FDECount encoding is DW_EH_PE_omit. Do not attempt to read the FDECount in such a situation as we will read an incorrect value. binutils only writes out the FDECount if the encoding is not DW_EH_PE_omit. llvm-svn: 316224
1 parent bb94161 commit f7596ec

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed
 

‎libunwind/src/EHHeaderParser.hpp

+3-1
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,9 @@ void EHHeaderParser<A>::decodeEHHdr(A &addressSpace, pint_t ehHdrStart,
6767
ehHdrInfo.eh_frame_ptr =
6868
addressSpace.getEncodedP(p, ehHdrEnd, eh_frame_ptr_enc, ehHdrStart);
6969
ehHdrInfo.fde_count =
70-
addressSpace.getEncodedP(p, ehHdrEnd, fde_count_enc, ehHdrStart);
70+
fde_count_enc == DW_EH_PE_omit
71+
? 0
72+
: addressSpace.getEncodedP(p, ehHdrEnd, fde_count_enc, ehHdrStart);
7173
ehHdrInfo.table = p;
7274
}
7375

0 commit comments

Comments
 (0)
Please sign in to comment.