File tree Expand file tree Collapse file tree 1 file changed +13
-0
lines changed
Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ use crate::strong_u64::U64BitsControl;
22use crate :: value:: * ;
33use crate :: vm:: VM ;
44use alloc:: format;
5+ use alloc:: string:: * ;
56
67impl VM {
78 pub fn op_call ( & mut self ) {
@@ -15,6 +16,12 @@ impl VM {
1516
1617 self . push_environment ( ) ;
1718
19+ let this_name = & String :: from ( "self" ) ;
20+ let environ = self . environs . last_mut ( ) . unwrap ( ) ;
21+ let environ = & mut * environ. borrow_mut ( ) ;
22+ environ. create_if_doesnt_exist ( this_name) ;
23+ * environ. get_mut ( this_name) . unwrap ( ) = core:: mem:: take ( & mut self . self_var ) ;
24+
1825 let start = self . bfas_stack_start . pop ( ) . unwrap ( ) ;
1926 let end = self . bfas_stack_end . pop ( ) . unwrap ( ) ;
2027 let diff = end - start;
@@ -35,6 +42,12 @@ impl VM {
3542
3643 self . environs . push ( env) ;
3744
45+ let this_name = & String :: from ( "self" ) ;
46+ let environ = self . environs . last_mut ( ) . unwrap ( ) ;
47+ let environ = & mut * environ. borrow_mut ( ) ;
48+ environ. create_if_doesnt_exist ( this_name) ;
49+ * environ. get_mut ( this_name) . unwrap ( ) = core:: mem:: take ( & mut self . self_var ) ;
50+
3851 let start = self . bfas_stack_start . pop ( ) . unwrap ( ) ;
3952 let end = self . bfas_stack_end . pop ( ) . unwrap ( ) ;
4053 let diff = end - start;
You can’t perform that action at this time.
0 commit comments