Use names that actually represent what's going on
This commit is contained in:
parent
90a8f2f6a3
commit
c69ebaaed2
4 changed files with 9 additions and 9 deletions
|
|
@ -77,19 +77,19 @@ pub fn report_msg<'tcx, 'mir>(
|
|||
}
|
||||
|
||||
thread_local! {
|
||||
static ECX: RefCell<Vec<NonHaltingDiagnostic>> = RefCell::new(Vec::new());
|
||||
static DIAGNOSTICS: RefCell<Vec<NonHaltingDiagnostic>> = RefCell::new(Vec::new());
|
||||
}
|
||||
|
||||
pub fn register_err(e: NonHaltingDiagnostic) {
|
||||
ECX.with(|ecx| ecx.borrow_mut().push(e));
|
||||
pub fn register_diagnostic(e: NonHaltingDiagnostic) {
|
||||
DIAGNOSTICS.with(|diagnostics| diagnostics.borrow_mut().push(e));
|
||||
}
|
||||
|
||||
impl<'mir, 'tcx> EvalContextExt<'mir, 'tcx> for crate::MiriEvalContext<'mir, 'tcx> {}
|
||||
pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx> {
|
||||
fn process_errors(&self) {
|
||||
fn process_diagnostics(&self) {
|
||||
let this = self.eval_context_ref();
|
||||
ECX.with(|ecx| {
|
||||
for e in ecx.borrow_mut().drain(..) {
|
||||
DIAGNOSTICS.with(|diagnostics| {
|
||||
for e in diagnostics.borrow_mut().drain(..) {
|
||||
let msg = match e {
|
||||
NonHaltingDiagnostic::PoppedTrackedPointerTag(item) =>
|
||||
format!("popped tracked tag for item {:?}", item),
|
||||
|
|
|
|||
|
|
@ -183,7 +183,7 @@ pub fn eval_main<'tcx>(tcx: TyCtxt<'tcx>, main_id: DefId, config: MiriConfig) ->
|
|||
// Perform the main execution.
|
||||
let res: InterpResult<'_, i64> = (|| {
|
||||
while ecx.step()? {
|
||||
ecx.process_errors();
|
||||
ecx.process_diagnostics();
|
||||
}
|
||||
// Read the return code pointer *before* we run TLS destructors, to assert
|
||||
// that it was written to by the time that `start` lang item returned.
|
||||
|
|
|
|||
|
|
@ -43,7 +43,7 @@ pub use crate::shims::tls::{EvalContextExt as TlsEvalContextExt, TlsData};
|
|||
pub use crate::shims::EvalContextExt as ShimsEvalContextExt;
|
||||
|
||||
pub use crate::diagnostics::{
|
||||
register_err, report_err, EvalContextExt as DiagnosticsEvalContextExt, NonHaltingDiagnostic,
|
||||
register_diagnostic, report_err, EvalContextExt as DiagnosticsEvalContextExt, NonHaltingDiagnostic,
|
||||
};
|
||||
pub use crate::eval::{create_ecx, eval_main, MiriConfig, TerminationInfo};
|
||||
pub use crate::helpers::EvalContextExt as HelpersEvalContextExt;
|
||||
|
|
|
|||
|
|
@ -266,7 +266,7 @@ impl<'tcx> Stack {
|
|||
fn check_protector(item: &Item, tag: Option<Tag>, global: &GlobalState) -> InterpResult<'tcx> {
|
||||
if let Tag::Tagged(id) = item.tag {
|
||||
if Some(id) == global.tracked_pointer_tag {
|
||||
register_err(NonHaltingDiagnostic::PoppedTrackedPointerTag(item.clone()));
|
||||
register_diagnostic(NonHaltingDiagnostic::PoppedTrackedPointerTag(item.clone()));
|
||||
}
|
||||
}
|
||||
if let Some(call) = item.protector {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue