Skip to content

Commit

Permalink
fix use of this.allocate_bytes
Browse files Browse the repository at this point in the history
  • Loading branch information
RalfJung committed Dec 12, 2024
1 parent 99c10f4 commit 98f8156
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions src/shims/time.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ use std::time::{Duration, SystemTime};

use chrono::{DateTime, Datelike, Offset, Timelike, Utc};
use chrono_tz::Tz;
use rustc_abi::Align;
use rustc_ast::ast::Mutability;

use crate::*;

Expand Down Expand Up @@ -202,12 +200,7 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
tm_zone.push('\0');

// Deduplicate and allocate the string.
let tm_zone_ptr = this.allocate_bytes(
tm_zone.as_bytes(),
Align::ONE,
MiriMemoryKind::Machine.into(),
Mutability::Not,
)?;
let tm_zone_ptr = this.allocate_bytes_dedup(tm_zone.as_bytes())?;

// Write the timezone pointer and offset into the result structure.
this.write_pointer(tm_zone_ptr, &this.project_field_named(&result, "tm_zone")?)?;
Expand Down

0 comments on commit 98f8156

Please sign in to comment.