File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -53,6 +53,8 @@ use crate::pe::options;
5353use crate :: pe:: section_table;
5454use crate :: pe:: utils;
5555
56+ /// **N**o handlers.
57+ const UNW_FLAG_NHANDLER : u8 = 0x00 ;
5658/// The function has an exception handler that should be called when looking for functions that need
5759/// to examine exceptions.
5860const UNW_FLAG_EHANDLER : u8 = 0x01 ;
@@ -567,13 +569,15 @@ impl<'a> UnwindInfo<'a> {
567569 let codes_size = count_of_codes as usize * UNWIND_CODE_SIZE ;
568570 let code_bytes = bytes. gread_with ( & mut offset, codes_size) ?;
569571
570- // For alignment purposes, the codes array always has an even number of entries, and the
572+ // For alignment purposes, the codes array typically has an even number of entries, and the
571573 // final entry is potentially unused. In that case, the array is one longer than indicated
572574 // by the count of unwind codes field.
575+ //
576+ // Sometimes, developers decided to handy craft unwind info in their assembly forget to align
577+ // unwind infos. This is not really desirable behavior for such cases anyway.
573578 if count_of_codes % 2 != 0 {
574579 offset += 2 ;
575580 }
576- debug_assert ! ( offset % 4 == 0 ) ;
577581
578582 let mut chained_info = None ;
579583 let mut handler = None ;
You can’t perform that action at this time.
0 commit comments