@@ -53,12 +53,12 @@ fn insert_null_check<'tcx>(
5353 user_ty : None ,
5454 const_ : Const :: Val ( ConstValue :: Scalar ( Scalar :: from_target_usize ( 0 , & tcx) ) , tcx. types . usize ) ,
5555 } ) ) ;
56- let is_pointee_zst =
56+ let is_pointee_no_zst =
5757 local_decls. push ( LocalDecl :: with_source_info ( tcx. types . bool , source_info) ) . into ( ) ;
5858 stmts. push ( Statement {
5959 source_info,
6060 kind : StatementKind :: Assign ( Box :: new ( (
61- is_pointee_zst ,
61+ is_pointee_no_zst ,
6262 Rvalue :: BinaryOp ( BinOp :: Eq , Box :: new ( ( Operand :: Copy ( sizeof_pointee) , zero. clone ( ) ) ) ) ,
6363 ) ) ) ,
6464 } ) ;
@@ -69,7 +69,7 @@ fn insert_null_check<'tcx>(
6969 source_info,
7070 kind : StatementKind :: Assign ( Box :: new ( (
7171 is_null,
72- Rvalue :: BinaryOp ( BinOp :: Ne , Box :: new ( ( Operand :: Copy ( addr) , zero) ) ) ,
72+ Rvalue :: BinaryOp ( BinOp :: Eq , Box :: new ( ( Operand :: Copy ( addr) , zero) ) ) ,
7373 ) ) ) ,
7474 } ) ;
7575
@@ -79,10 +79,10 @@ fn insert_null_check<'tcx>(
7979 stmts. push ( Statement {
8080 source_info,
8181 kind : StatementKind :: Assign ( Box :: new ( (
82- is_null ,
82+ should_throw_exception ,
8383 Rvalue :: BinaryOp (
84- BinOp :: BitOr ,
85- Box :: new ( ( Operand :: Copy ( is_null) , Operand :: Copy ( is_pointee_zst ) ) ) ,
84+ BinOp :: BitAnd ,
85+ Box :: new ( ( Operand :: Copy ( is_null) , Operand :: Copy ( is_pointee_no_zst ) ) ) ,
8686 ) ,
8787 ) ) ) ,
8888 } ) ;
0 commit comments