pub fn replace_unexpected_zero_register(
    backend: &mut CodeGenerator,
    val: &P<Value>,
    f_context: &mut FunctionContext,
    vm: &VM
) -> P<Value> {
    if is_zero_register(&val) {
        let temp = make_temporary(f_context, val.ty.clone(), vm);
        backend.emit_mov_imm(&temp, 0);
        temp
    } else {
        val.clone()
    }
}
/*
Just insert this immediatly before each emit_XX where XX is one the above instructions,
and arg is the name of the argument that can't be the zero register (do so for each such argument)
let arg = replace_zero_register(backend, &arg, f_context, vm);
*/
Just insert this immediatly before each emit_XX where XX is one the above instructions,
and arg is the name of the argument that can't be the zero register (do so for each such argument)
let arg = replace_zero_register(backend, &arg, f_context, vm).
Just insert this immediatly before each emit_XX where XX is one the above instructions and arg is the name of the argument that can ' t be the zero register ( do so for each such argument ) let arg = replace_zero_register ( backend &arg f_context vm ) .
pub fn replace_unexpected_zero_register(
    backend: &mut CodeGenerator,
    val: &P<Value>,
    f_context: &mut FunctionContext,
    vm: &VM
) -> P<Value> {
    if is_zero_register(&val) {
        let temp = make_temporary(f_context, val.ty.clone(), vm);
        backend.emit_mov_imm(&temp, 0);
        temp
    } else {
        val.clone()
    }
}
pub fn replace_unexpected_zero_register ( backend : & mut CodeGenerator , val : & P < Value > , f_context : & mut FunctionContext , vm : & VM ) -> P < Value > { if is_zero_register ( & val ) { let temp = make_temporary ( f_context , val . ty . clone ( ) , vm ) ; backend . emit_mov_imm ( & temp , 0 ) ; temp } else { val . clone ( ) } }
Just insert this immediatly before each emit_XX where XX is one the above instructions,
and arg is the name of the argument that can't be the zero register (do so for each such argument)
let arg = replace_zero_register(backend, &arg, f_context, vm);
Just insert this immediatly before each emit_XX where XX is one the above instructions and arg is the name of the argument that can ' t be the zero register ( do so for each such argument ) let arg = replace_zero_register ( backend &arg f_context vm ) ;
backend
&mut CodeGenerator
val
&P<Value>
f_context
&mut FunctionContext
vm
&VM
backend
&mut CodeGenerator
val
&P<Value>
f_context
&mut FunctionContext
vm
&VM