Eliminate the sig argument to translate_operator.
The current function's return types are pushed as the first control stack frame.
This commit is contained in:
@@ -126,7 +126,6 @@ pub fn translate_function_body(
|
|||||||
&mut builder,
|
&mut builder,
|
||||||
runtime,
|
runtime,
|
||||||
&mut state,
|
&mut state,
|
||||||
sig,
|
|
||||||
functions,
|
functions,
|
||||||
signatures,
|
signatures,
|
||||||
exports,
|
exports,
|
||||||
@@ -171,7 +170,6 @@ fn translate_operator(
|
|||||||
builder: &mut FunctionBuilder<Local>,
|
builder: &mut FunctionBuilder<Local>,
|
||||||
runtime: &mut WasmRuntime,
|
runtime: &mut WasmRuntime,
|
||||||
state: &mut TranslationState,
|
state: &mut TranslationState,
|
||||||
sig: &Signature,
|
|
||||||
functions: &[SignatureIndex],
|
functions: &[SignatureIndex],
|
||||||
signatures: &[Signature],
|
signatures: &[Signature],
|
||||||
exports: &Option<HashMap<FunctionIndex, String>>,
|
exports: &Option<HashMap<FunctionIndex, String>>,
|
||||||
@@ -439,7 +437,7 @@ fn translate_operator(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
Operator::Return => {
|
Operator::Return => {
|
||||||
let return_count = sig.return_types.len();
|
let return_count = state.control_stack[0].return_values().len();
|
||||||
let cut_index = state.stack.len() - return_count;
|
let cut_index = state.stack.len() - return_count;
|
||||||
builder.ins().return_(&state.stack[cut_index..]);
|
builder.ins().return_(&state.stack[cut_index..]);
|
||||||
state.stack.truncate(cut_index);
|
state.stack.truncate(cut_index);
|
||||||
|
|||||||
Reference in New Issue
Block a user