@@ -150,30 +150,31 @@ impl UnwindContext {
150150 next_action : None ,
151151 } ) ;
152152
153- //println!("{:?}", context.compiled_code().unwrap().buffer.call_sites());
154- for & ( ret_addr, tag, landingpad) in
155- & context. compiled_code ( ) . unwrap ( ) . buffer . exception_handlers
156- {
157- match call_site. id . map ( |id| id. bits ( ) ) {
158- None => gcc_except_table_data. call_sites . 0 . push ( CallSite {
159- start : u64:: from ( ret_addr - 1 ) ,
153+ for call_site in context. compiled_code ( ) . unwrap ( ) . buffer . call_sites ( ) {
154+ if call_site. exception_handlers . is_empty ( ) {
155+ gcc_except_table_data. call_sites . 0 . push ( CallSite {
156+ start : u64:: from ( call_site. ret_addr - 1 ) ,
160157 length : 1 ,
161158 landing_pad : 0 ,
162159 action_entry : None ,
163- } ) ,
164- Some ( 0 ) => gcc_except_table_data. call_sites . 0 . push ( CallSite {
165- start : u64:: from ( ret_addr - 1 ) ,
166- length : 1 ,
167- landing_pad : u64:: from ( landingpad) ,
168- action_entry : None ,
169- } ) ,
170- Some ( 1 ) => gcc_except_table_data. call_sites . 0 . push ( CallSite {
171- start : u64:: from ( ret_addr - 1 ) ,
172- length : 1 ,
173- landing_pad : u64:: from ( landingpad) ,
174- action_entry : Some ( catch_action) ,
175- } ) ,
176- _ => unreachable ! ( ) ,
160+ } ) ;
161+ }
162+ for & ( tag, landingpad) in & call_site. exception_handlers {
163+ match tag. expand ( ) . unwrap ( ) . as_u32 ( ) {
164+ 0 => gcc_except_table_data. call_sites . 0 . push ( CallSite {
165+ start : u64:: from ( call_site. ret_addr - 1 ) ,
166+ length : 1 ,
167+ landing_pad : u64:: from ( landingpad) ,
168+ action_entry : None ,
169+ } ) ,
170+ 1 => gcc_except_table_data. call_sites . 0 . push ( CallSite {
171+ start : u64:: from ( call_site. ret_addr - 1 ) ,
172+ length : 1 ,
173+ landing_pad : u64:: from ( landingpad) ,
174+ action_entry : Some ( catch_action) ,
175+ } ) ,
176+ _ => unreachable ! ( ) ,
177+ }
177178 }
178179 }
179180 //println!("{gcc_except_table_data:?}");
0 commit comments