@@ -26,8 +26,8 @@ use rustc_target::abi::{call::FnAbi, Align, HasDataLayout, Size, TargetDataLayou
26
26
use super :: {
27
27
err_inval, throw_inval, throw_ub, throw_ub_custom, throw_unsup, GlobalId , Immediate ,
28
28
InterpErrorInfo , InterpResult , MPlaceTy , Machine , MemPlace , MemPlaceMeta , Memory , MemoryKind ,
29
- OpTy , Operand , Place , PlaceTy , Pointer , PointerArithmetic , Projectable , Provenance , Scalar ,
30
- StackPopJump ,
29
+ OpTy , Operand , Place , PlaceTy , Pointer , PointerArithmetic , Projectable , Provenance ,
30
+ ReturnAction , Scalar ,
31
31
} ;
32
32
use crate :: errors;
33
33
use crate :: util;
@@ -161,9 +161,15 @@ pub enum StackPopCleanup {
161
161
162
162
/// Return type of [`InterpCx::pop_stack_frame`].
163
163
pub struct StackPop < ' tcx , Prov : Provenance > {
164
- pub jump : StackPopJump ,
165
- pub target : StackPopCleanup ,
166
- pub destination : MPlaceTy < ' tcx , Prov > ,
164
+ /// Additional information about the action to be performed when returning from the popped
165
+ /// stack frame.
166
+ pub return_action : ReturnAction ,
167
+
168
+ /// [`return_to_block`](Frame::return_to_block) of the popped stack frame.
169
+ pub return_to_block : StackPopCleanup ,
170
+
171
+ /// [`return_place`](Frame::return_place) of the popped stack frame.
172
+ pub return_place : MPlaceTy < ' tcx , Prov > ,
167
173
}
168
174
169
175
/// State of a local variable including a memoized layout
@@ -890,16 +896,16 @@ impl<'tcx, M: Machine<'tcx>> InterpCx<'tcx, M> {
890
896
let frame =
891
897
self . stack_mut ( ) . pop ( ) . expect ( "tried to pop a stack frame, but there were none" ) ;
892
898
893
- let target = frame. return_to_block ;
894
- let destination = frame. return_place . clone ( ) ;
899
+ let return_to_block = frame. return_to_block ;
900
+ let return_place = frame. return_place . clone ( ) ;
895
901
896
- let jump = if cleanup {
902
+ let return_action = if cleanup {
897
903
M :: after_stack_pop ( self , frame, unwinding) ?
898
904
} else {
899
- StackPopJump :: NoCleanup
905
+ ReturnAction :: NoCleanup
900
906
} ;
901
907
902
- Ok ( StackPop { jump , target , destination } )
908
+ Ok ( StackPop { return_action , return_to_block , return_place } )
903
909
}
904
910
905
911
/// A private helper for [`pop_stack_frame`](InterpCx::pop_stack_frame).
@@ -1042,13 +1048,13 @@ impl<'tcx, M: Machine<'tcx>> InterpCx<'tcx, M> {
1042
1048
// Report error from return value copy, if any.
1043
1049
copy_ret_result?;
1044
1050
1045
- match frame. jump {
1046
- StackPopJump :: Normal => { }
1047
- StackPopJump :: NoJump => {
1051
+ match frame. return_action {
1052
+ ReturnAction :: Normal => { }
1053
+ ReturnAction :: NoJump => {
1048
1054
// The hook already did everything.
1049
1055
return Ok ( ( ) ) ;
1050
1056
}
1051
- StackPopJump :: NoCleanup => {
1057
+ ReturnAction :: NoCleanup => {
1052
1058
// If we are not doing cleanup, also skip everything else.
1053
1059
assert ! ( self . stack( ) . is_empty( ) , "only the topmost frame should ever be leaked" ) ;
1054
1060
assert ! ( !unwinding, "tried to skip cleanup during unwinding" ) ;
@@ -1060,7 +1066,7 @@ impl<'tcx, M: Machine<'tcx>> InterpCx<'tcx, M> {
1060
1066
// Normal return, figure out where to jump.
1061
1067
if unwinding {
1062
1068
// Follow the unwind edge.
1063
- let unwind = match frame. target {
1069
+ let unwind = match frame. return_to_block {
1064
1070
StackPopCleanup :: Goto { unwind, .. } => unwind,
1065
1071
StackPopCleanup :: Root { .. } => {
1066
1072
panic ! ( "encountered StackPopCleanup::Root when unwinding!" )
@@ -1070,7 +1076,7 @@ impl<'tcx, M: Machine<'tcx>> InterpCx<'tcx, M> {
1070
1076
self . unwind_to_block ( unwind)
1071
1077
} else {
1072
1078
// Follow the normal return edge.
1073
- match frame. target {
1079
+ match frame. return_to_block {
1074
1080
StackPopCleanup :: Goto { ret, .. } => self . return_to_block ( ret) ,
1075
1081
StackPopCleanup :: Root { .. } => {
1076
1082
assert ! (
0 commit comments