File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed
src/librustc_codegen_llvm Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -952,11 +952,15 @@ fn codegen_msvc_try(
952952 let cs = catchswitch. catch_switch ( None , None , 1 ) ;
953953 catchswitch. add_handler ( cs, catchpad. llbb ( ) ) ;
954954
955+ // The flag value of 8 indicates that we are catching the exception by
956+ // reference instead of by value.
957+ //
958+ // Source: MicrosoftCXXABI::getAddrOfCXXCatchHandlerType in clang
959+ let flags = bx. const_i32 ( 8 ) ;
955960 let tydesc = match bx. tcx ( ) . lang_items ( ) . eh_catch_typeinfo ( ) {
956961 Some ( did) => bx. get_static ( did) ,
957962 None => bug ! ( "eh_catch_typeinfo not defined, but needed for SEH unwinding" ) ,
958963 } ;
959- let flags = bx. const_i32 ( 8 ) ; // Catch by reference
960964 let funclet = catchpad. catch_pad ( cs, & [ tydesc, flags, slot] ) ;
961965
962966 let i64_align = bx. tcx ( ) . data_layout . i64_align . abi ;
You can’t perform that action at this time.
0 commit comments