Skip to content

Commit e1c42e5

Browse files
committed
Begin updating for rustc changes
1 parent 26ab2cc commit e1c42e5

File tree

4 files changed

+18
-11
lines changed

4 files changed

+18
-11
lines changed

src/fn_call.rs

+4-3
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,7 @@ pub trait EvalContextExt<'a, 'mir, 'tcx: 'a + 'mir>: crate::MiriEvalContextExt<'
292292
box_me_up_mir.span,
293293
box_me_up_mir,
294294
Some(temp_ptr.into()),
295-
StackPopCleanup::None { cleanup: true }
295+
StackPopCleanup::None { cleanup: true, unwind: None }
296296
)?;
297297

298298
let mut args = this.frame().mir.args_iter();
@@ -566,7 +566,7 @@ pub trait EvalContextExt<'a, 'mir, 'tcx: 'a + 'mir>: crate::MiriEvalContextExt<'
566566
mir,
567567
Some(ret_place),
568568
// Directly return to caller.
569-
StackPopCleanup::Goto(Some(ret)),
569+
StackPopCleanup::Goto { ret: Some(ret), unwind: None },
570570
)?;
571571

572572
let mut args = this.frame().mir.args_iter();
@@ -1226,7 +1226,8 @@ fn unwind_stack<'a, 'mir, 'tcx>(
12261226
}
12271227

12281228
// Pop this frame, and continue on to the next one
1229-
this.pop_stack_frame_unwind()?;
1229+
//this.pop_stack_frame()?;
1230+
//this.pop_stack_frame_unwind()?;
12301231
}
12311232
}
12321233

src/helpers.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ pub trait EvalContextExt<'a, 'mir, 'tcx: 'a + 'mir>: crate::MiriEvalContextExt<'
2727
for item in mem::replace(&mut items, Default::default()).iter() {
2828
if item.ident.name.as_str() == *segment {
2929
if path_it.peek().is_none() {
30-
return Some(ty::Instance::mono(this.tcx.tcx, item.def.def_id()));
30+
return Some(ty::Instance::mono(this.tcx.tcx, item.res.def_id()).def_id());
3131
}
3232

3333
items = this.tcx.item_children(item.res.def_id());

src/lib.rs

+12-6
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ pub fn create_ecx<'a, 'mir: 'a, 'tcx: 'mir>(
124124
DUMMY_SP,
125125
start_mir,
126126
Some(ret_ptr.into()),
127-
StackPopCleanup::None { cleanup: true },
127+
StackPopCleanup::None { cleanup: true, unwind: None },
128128
)?;
129129

130130
let mut args = ecx.frame().mir.args_iter();
@@ -375,7 +375,11 @@ pub struct Evaluator<'tcx> {
375375

376376
/// Extra information needed for unwinding
377377
/// This is 'None' when we're running in abort mode
378-
pub(crate) cached_data: Option<CachedTypes<'tcx>>
378+
pub(crate) cached_data: Option<CachedTypes<'tcx>>,
379+
380+
/// Whether or not we are currently unwinding from
381+
/// a panic
382+
pub(crate) unwinding: bool
379383
}
380384

381385
pub struct CachedTypes<'tcx> {
@@ -394,7 +398,8 @@ impl<'tcx> Evaluator<'tcx> {
394398
tls: TlsData::default(),
395399
validate,
396400
rng: seed.map(|s| StdRng::seed_from_u64(s)),
397-
cached_data: None
401+
cached_data: None,
402+
unwinding: false
398403
}
399404
}
400405
}
@@ -503,7 +508,7 @@ impl<'a, 'mir, 'tcx> Machine<'a, 'mir, 'tcx> for Evaluator<'tcx> {
503508
// Don't do anything when we are done. The `statement()` function will increment
504509
// the old stack frame's stmt counter to the next statement, which means that when
505510
// `exchange_malloc` returns, we go on evaluating exactly where we want to be.
506-
StackPopCleanup::None { cleanup: true },
511+
StackPopCleanup::None { cleanup: true, unwind: None },
507512
)?;
508513

509514
let mut args = ecx.frame().mir.args_iter();
@@ -636,7 +641,8 @@ impl<'a, 'mir, 'tcx> Machine<'a, 'mir, 'tcx> for Evaluator<'tcx> {
636641
fn stack_pop(
637642
ecx: &mut InterpretCx<'a, 'mir, 'tcx, Self>,
638643
extra: FrameData,
639-
) -> EvalResult<'tcx> {
640-
Ok(ecx.memory().extra.borrow_mut().end_call(extra.call_id))
644+
) -> EvalResult<'tcx, StackPopInfo> {
645+
ecx.memory().extra.borrow_mut().end_call(extra.call_id);
646+
Ok(StackPopInfo { unwinding: ecx.machine.unwinding })
641647
}
642648
}

src/tls.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ pub trait EvalContextExt<'a, 'mir, 'tcx: 'a+'mir>: crate::MiriEvalContextExt<'a,
146146
mir.span,
147147
mir,
148148
Some(ret_place),
149-
StackPopCleanup::None { cleanup: true },
149+
StackPopCleanup::None { cleanup: true, unwind: None },
150150
)?;
151151
let arg_local = this.frame().mir.args_iter().next().ok_or_else(
152152
|| InterpError::AbiViolation("TLS dtor does not take enough arguments.".to_owned()),

0 commit comments

Comments
 (0)