fuzzbug fix
This commit is contained in:
parent
c0fd7e8fc8
commit
87c416cadf
|
@ -160,7 +160,7 @@ pub fn produce_func_wasm<FT: FuncTypeSink>(
|
||||||
locals: vec![],
|
locals: vec![],
|
||||||
};
|
};
|
||||||
wasm.locals
|
wasm.locals
|
||||||
.extend(f.locals.iter().map(|ty| ty_to_valty(*ty)));
|
.extend(f.locals.iter().skip(f.n_params).map(|ty| ty_to_valty(*ty)));
|
||||||
wasm.locals
|
wasm.locals
|
||||||
.extend(locations.new_locals.iter().map(|ty| ty_to_valty(*ty)));
|
.extend(locations.new_locals.iter().map(|ty| ty_to_valty(*ty)));
|
||||||
|
|
||||||
|
|
|
@ -109,6 +109,7 @@ fn parse_body<'a>(
|
||||||
for ¶m in &module.signatures[my_sig].params[..] {
|
for ¶m in &module.signatures[my_sig].params[..] {
|
||||||
ret.locals.push(param);
|
ret.locals.push(param);
|
||||||
}
|
}
|
||||||
|
ret.n_params = module.signatures[my_sig].params.len();
|
||||||
for &r in &module.signatures[my_sig].returns[..] {
|
for &r in &module.signatures[my_sig].returns[..] {
|
||||||
ret.rets.push(r);
|
ret.rets.push(r);
|
||||||
}
|
}
|
||||||
|
|
|
@ -53,6 +53,7 @@ impl FuncDecl {
|
||||||
|
|
||||||
#[derive(Clone, Debug, Default)]
|
#[derive(Clone, Debug, Default)]
|
||||||
pub struct FunctionBody {
|
pub struct FunctionBody {
|
||||||
|
pub n_params: usize,
|
||||||
pub rets: Vec<Type>,
|
pub rets: Vec<Type>,
|
||||||
pub locals: Vec<Type>,
|
pub locals: Vec<Type>,
|
||||||
pub blocks: Vec<Block>,
|
pub blocks: Vec<Block>,
|
||||||
|
|
Loading…
Reference in a new issue