@@ -132,7 +132,7 @@ impl<'a, 'mir, 'tcx: 'mir + 'a> EvalContextExt<'tcx, 'mir> for super::MiriEvalCo
132132
133133 "free" => {
134134 let ptr = self . read_scalar ( args[ 0 ] ) ?. not_undef ( ) ?. erase_tag ( ) ; // raw ptr operation, no tag
135- if !ptr. is_null ( ) {
135+ if !ptr. is_null_ptr ( & self ) {
136136 self . memory . deallocate (
137137 ptr. to_ptr ( ) ?. with_default_tag ( ) ,
138138 None ,
@@ -353,7 +353,7 @@ impl<'a, 'mir, 'tcx: 'mir + 'a> EvalContextExt<'tcx, 'mir> for super::MiriEvalCo
353353 let mut success = None ;
354354 {
355355 let name_ptr = self . read_scalar ( args[ 0 ] ) ?. not_undef ( ) ?. erase_tag ( ) ; // raw ptr operation
356- if !name_ptr. is_null ( ) {
356+ if !name_ptr. is_null_ptr ( & self ) {
357357 let name = self . memory . read_c_str ( name_ptr. to_ptr ( ) ?. with_default_tag ( ) ) ?;
358358 if !name. is_empty ( ) && !name. contains ( & b'=' ) {
359359 success = Some ( self . machine . env_vars . remove ( name) ) ;
@@ -376,7 +376,7 @@ impl<'a, 'mir, 'tcx: 'mir + 'a> EvalContextExt<'tcx, 'mir> for super::MiriEvalCo
376376 let name_ptr = self . read_scalar ( args[ 0 ] ) ?. not_undef ( ) ?. erase_tag ( ) ; // raw ptr operation
377377 let value_ptr = self . read_scalar ( args[ 1 ] ) ?. to_ptr ( ) ?. erase_tag ( ) ; // raw ptr operation
378378 let value = self . memory . read_c_str ( value_ptr. with_default_tag ( ) ) ?;
379- if !name_ptr. is_null ( ) {
379+ if !name_ptr. is_null_ptr ( & self ) {
380380 let name = self . memory . read_c_str ( name_ptr. to_ptr ( ) ?. with_default_tag ( ) ) ?;
381381 if !name. is_empty ( ) && !name. contains ( & b'=' ) {
382382 new = Some ( ( name. to_owned ( ) , value. to_owned ( ) ) ) ;
0 commit comments