pub fn register_dereference(state: &AbstractState) -> Result<AbstractState, VMError> {
    let mut state = state.clone();
    if let Some(abstract_value) = state.register_move() {
        match abstract_value.token {
            SignatureToken::MutableReference(token) => {
                state.register_set(AbstractValue {
                    token: *token,
                    kind: abstract_value.kind,
                });
                Ok(state)
            }
            SignatureToken::Reference(token) => {
                state.register_set(AbstractValue {
                    token: *token,
                    kind: abstract_value.kind,
                });
                Ok(state)
            }
            _ => Err(VMError::new(
                "Register does not contain a reference".to_string(),
            )),
        }
    } else {
        Err(VMError::new("Register is empty".to_string()))
    }
}
/// Dereference the value stored in the register. If the value is not a reference, or
/// the register is empty, return an error.
Dereference the value stored in the register. If the value is not a reference, or
the register is empty, return an error.
Dereference the value stored in the register . If the value is not a reference or the register is empty return an error .
pub fn register_dereference(state: &AbstractState) -> Result<AbstractState, VMError> {
    let mut state = state.clone();
    if let Some(abstract_value) = state.register_move() {
        match abstract_value.token {
            SignatureToken::MutableReference(token) => {
                state.register_set(AbstractValue {
                    token: *token,
                    kind: abstract_value.kind,
                });
                Ok(state)
            }
            SignatureToken::Reference(token) => {
                state.register_set(AbstractValue {
                    token: *token,
                    kind: abstract_value.kind,
                });
                Ok(state)
            }
            _ => Err(VMError::new(
                "Register does not contain a reference".to_string(),
            )),
        }
    } else {
        Err(VMError::new("Register is empty".to_string()))
    }
}
pub fn register_dereference ( state : & AbstractState ) -> Result < AbstractState , VMError > { let mut state = state . clone ( ) ; if let Some ( abstract_value ) = state . register_move ( ) { match abstract_value . token { SignatureToken :: MutableReference ( token ) => { state . register_set ( AbstractValue { token : * token , kind : abstract_value . kind , } ) ; Ok ( state ) } SignatureToken :: Reference ( token ) => { state . register_set ( AbstractValue { token : * token , kind : abstract_value . kind , } ) ; Ok ( state ) } _ => Err ( VMError :: new ( " " . to_string ( ) , ) ) , } } else { Err ( VMError :: new ( " " . to_string ( ) ) ) } }
Dereference the value stored in the register.
Dereference the value stored in the register .
state
&AbstractState