@@ -435,12 +435,12 @@ impl<'a, 'gcc, 'tcx> BuilderMethods<'a, 'tcx> for Builder<'a, 'gcc, 'tcx> {
435435 self . block . end_with_switch ( None , value, default_block, & gcc_cases) ;
436436 }
437437
438- fn invoke ( & mut self , _typ : Type < ' gcc > , _func : RValue < ' gcc > , _args : & [ RValue < ' gcc > ] , then : Block < ' gcc > , catch : Block < ' gcc > , _funclet : Option < & Funclet > ) -> RValue < ' gcc > {
439- let condition = self . context . new_rvalue_from_int ( self . bool_type , 0 ) ;
438+ fn invoke ( & mut self , typ : Type < ' gcc > , func : RValue < ' gcc > , args : & [ RValue < ' gcc > ] , then : Block < ' gcc > , catch : Block < ' gcc > , _funclet : Option < & Funclet > ) -> RValue < ' gcc > {
439+ // TODO(bjorn3): Properly implement unwinding.
440+ let call_site = self . call ( typ, func, args, None ) ;
441+ let condition = self . context . new_rvalue_from_int ( self . bool_type , 1 ) ;
440442 self . llbb ( ) . end_with_conditional ( None , condition, then, catch) ;
441- self . context . new_rvalue_from_int ( self . int_type , 0 )
442-
443- // TODO(antoyo)
443+ call_site
444444 }
445445
446446 fn unreachable ( & mut self ) {
@@ -1106,7 +1106,7 @@ impl<'a, 'gcc, 'tcx> BuilderMethods<'a, 'tcx> for Builder<'a, 'gcc, 'tcx> {
11061106 }
11071107
11081108 fn cleanup_landing_pad ( & mut self , _ty : Type < ' gcc > , _pers_fn : RValue < ' gcc > ) -> RValue < ' gcc > {
1109- let field1 = self . context . new_field ( None , self . u8_type , "landing_pad_field_1" ) ;
1109+ let field1 = self . context . new_field ( None , self . u8_type . make_pointer ( ) , "landing_pad_field_1" ) ;
11101110 let field2 = self . context . new_field ( None , self . i32_type , "landing_pad_field_1" ) ;
11111111 let struct_type = self . context . new_struct_type ( None , "landing_pad" , & [ field1, field2] ) ;
11121112 self . current_func ( ) . new_local ( None , struct_type. as_type ( ) , "landing_pad" )
@@ -1117,7 +1117,8 @@ impl<'a, 'gcc, 'tcx> BuilderMethods<'a, 'tcx> for Builder<'a, 'gcc, 'tcx> {
11171117 }
11181118
11191119 fn resume ( & mut self , _exn : RValue < ' gcc > ) {
1120- unimplemented ! ( ) ;
1120+ // TODO(bjorn3): Properly implement unwinding.
1121+ self . unreachable ( ) ;
11211122 }
11221123
11231124 fn cleanup_pad ( & mut self , _parent : Option < RValue < ' gcc > > , _args : & [ RValue < ' gcc > ] ) -> Funclet {
0 commit comments