Skip to content

Rustup #1492

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jul 30, 2020
Merged

Rustup #1492

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion rust-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1454bbd4fdac9b7272b93fe82860613dccc0afad
21867225a74d3b07c2b65e32c67f45197db36896
3 changes: 1 addition & 2 deletions src/diagnostics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -137,8 +137,7 @@ pub fn report_error<'tcx, 'mir>(
access.uninit_ptr.offset.bytes(),
access.uninit_ptr.offset.bytes() + access.uninit_size.bytes(),
);
ecx.memory.dump_alloc(access.uninit_ptr.alloc_id);
eprintln!();
eprintln!("{:?}", ecx.memory.dump_alloc(access.uninit_ptr.alloc_id));
}
_ => {}
}
Expand Down
4 changes: 3 additions & 1 deletion src/shims/foreign_items.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
use std::{convert::{TryInto, TryFrom}, iter};

use log::trace;

use rustc_hir::def_id::DefId;
use rustc_middle::{mir, ty};
use rustc_target::abi::{Align, Size};
Expand Down Expand Up @@ -175,7 +177,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx

// Third: functions that return.
if this.emulate_foreign_item_by_name(link_name, args, dest, ret)? {
this.dump_place(*dest);
trace!("{:?}", this.dump_place(*dest));
this.go_to_block(ret);
}

Expand Down
22 changes: 3 additions & 19 deletions src/shims/intrinsics.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
use std::iter;

use log::trace;

use rustc_attr as attr;
use rustc_ast::ast::FloatTy;
use rustc_middle::{mir, ty};
Expand Down Expand Up @@ -482,24 +484,6 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
}
}

"min_align_of_val" => {
let &[mplace] = check_arg_count(args)?;
let mplace = this.deref_operand(mplace)?;
let (_, align) = this
.size_and_align_of_mplace(mplace)?
.expect("size_of_val called on extern type");
this.write_scalar(Scalar::from_machine_usize(align.bytes(), this), dest)?;
}

"size_of_val" => {
let &[mplace] = check_arg_count(args)?;
let mplace = this.deref_operand(mplace)?;
let (size, _) = this
.size_and_align_of_mplace(mplace)?
.expect("size_of_val called on extern type");
this.write_scalar(Scalar::from_machine_usize(size.bytes(), this), dest)?;
}

// Other
"assume" => {
let &[cond] = check_arg_count(args)?;
Expand All @@ -524,7 +508,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
name => throw_unsup_format!("unimplemented intrinsic: {}", name),
}

this.dump_place(*dest);
trace!("{:?}", this.dump_place(*dest));
this.go_to_block(ret);
Ok(())
}
Expand Down
4 changes: 3 additions & 1 deletion src/shims/posix/macos/dlsym.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
use rustc_middle::mir;

use log::trace;

use crate::*;
use helpers::check_arg_count;

Expand Down Expand Up @@ -42,7 +44,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
}
}

this.dump_place(*dest);
trace!("{:?}", this.dump_place(*dest));
this.go_to_block(ret);
Ok(())
}
Expand Down
4 changes: 3 additions & 1 deletion src/shims/windows/dlsym.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
use rustc_middle::mir;

use log::trace;

use crate::*;
use helpers::check_arg_count;
use shims::windows::sync::EvalContextExt as _;
Expand Down Expand Up @@ -73,7 +75,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
}
}

this.dump_place(*dest);
trace!("{:?}", this.dump_place(*dest));
this.go_to_block(ret);
Ok(())
}
Expand Down