Auto merge of #2312 - RalfJung:misc, r=RalfJung
put call to stacked borrows end_call in a more sensible place This looks like a refactoring accident.
This commit is contained in:
commit
c674f2604b
11
README.md
11
README.md
@ -65,9 +65,9 @@ in your program, and cannot run all programs:
|
|||||||
not support networking. System API support varies between targets; if you run
|
not support networking. System API support varies between targets; if you run
|
||||||
on Windows it is a good idea to use `--target x86_64-unknown-linux-gnu` to get
|
on Windows it is a good idea to use `--target x86_64-unknown-linux-gnu` to get
|
||||||
better support.
|
better support.
|
||||||
* Weak memory emulation may produce weak behaivours unobservable by compiled
|
* Weak memory emulation may [produce weak behaivours](https://github.com/rust-lang/miri/issues/2301)
|
||||||
programs running on real hardware when `SeqCst` fences are used, and it cannot
|
unobservable by compiled programs running on real hardware when `SeqCst` fences are used, and it
|
||||||
produce all behaviors possibly observable on real hardware.
|
cannot produce all behaviors possibly observable on real hardware.
|
||||||
|
|
||||||
[rust]: https://www.rust-lang.org/
|
[rust]: https://www.rust-lang.org/
|
||||||
[mir]: https://github.com/rust-lang/rfcs/blob/master/text/1211-mir.md
|
[mir]: https://github.com/rust-lang/rfcs/blob/master/text/1211-mir.md
|
||||||
@ -192,8 +192,9 @@ randomness that is used to determine allocation base addresses. The following
|
|||||||
snippet calls Miri in a loop with different values for the seed:
|
snippet calls Miri in a loop with different values for the seed:
|
||||||
|
|
||||||
```
|
```
|
||||||
for seed in $({ echo obase=16; seq 0 255; } | bc); do
|
for SEED in $({ echo obase=16; seq 0 255; } | bc); do
|
||||||
MIRIFLAGS=-Zmiri-seed=$seed cargo miri test || { echo "Last seed: $seed"; break; };
|
echo "Trying seed: $SEED"
|
||||||
|
MIRIFLAGS=-Zmiri-seed=$SEED cargo miri test || { echo "Failing seed: $SEED"; break; };
|
||||||
done
|
done
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -930,7 +930,10 @@ impl<'mir, 'tcx> Machine<'mir, 'tcx> for Evaluator<'mir, 'tcx> {
|
|||||||
unwinding: bool,
|
unwinding: bool,
|
||||||
) -> InterpResult<'tcx, StackPopJump> {
|
) -> InterpResult<'tcx, StackPopJump> {
|
||||||
let timing = frame.extra.timing.take();
|
let timing = frame.extra.timing.take();
|
||||||
let res = ecx.handle_stack_pop(frame.extra, unwinding);
|
if let Some(stacked_borrows) = &ecx.machine.stacked_borrows {
|
||||||
|
stacked_borrows.borrow_mut().end_call(frame.extra.call_id);
|
||||||
|
}
|
||||||
|
let res = ecx.handle_stack_pop_unwind(frame.extra, unwinding);
|
||||||
if let Some(profiler) = ecx.machine.profiler.as_ref() {
|
if let Some(profiler) = ecx.machine.profiler.as_ref() {
|
||||||
profiler.finish_recording_interval_event(timing.unwrap());
|
profiler.finish_recording_interval_event(timing.unwrap());
|
||||||
}
|
}
|
||||||
|
@ -115,17 +115,13 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
|
|||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
fn handle_stack_pop(
|
fn handle_stack_pop_unwind(
|
||||||
&mut self,
|
&mut self,
|
||||||
mut extra: FrameData<'tcx>,
|
mut extra: FrameData<'tcx>,
|
||||||
unwinding: bool,
|
unwinding: bool,
|
||||||
) -> InterpResult<'tcx, StackPopJump> {
|
) -> InterpResult<'tcx, StackPopJump> {
|
||||||
let this = self.eval_context_mut();
|
let this = self.eval_context_mut();
|
||||||
|
trace!("handle_stack_pop_unwind(extra = {:?}, unwinding = {})", extra, unwinding);
|
||||||
trace!("handle_stack_pop(extra = {:?}, unwinding = {})", extra, unwinding);
|
|
||||||
if let Some(stacked_borrows) = &this.machine.stacked_borrows {
|
|
||||||
stacked_borrows.borrow_mut().end_call(extra.call_id);
|
|
||||||
}
|
|
||||||
|
|
||||||
// We only care about `catch_panic` if we're unwinding - if we're doing a normal
|
// We only care about `catch_panic` if we're unwinding - if we're doing a normal
|
||||||
// return, then we don't need to do anything special.
|
// return, then we don't need to do anything special.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user