Fix table indexing
This commit is contained in:
parent
f8446971d6
commit
583f96f857
@ -238,7 +238,7 @@ impl<'a> Body<'a> {
|
||||
}
|
||||
Instruction::CallIndirect(i, t) => {
|
||||
let index = func.var_name_of(self.reg.pop(1));
|
||||
let name = format!("TABLE_LIST[{}][{}]", t, index);
|
||||
let name = format!("TABLE_LIST[{}].data[{}]", t, index);
|
||||
let types = m.parent.type_section().unwrap().types();
|
||||
let arity = Arity::from_index(types, *i);
|
||||
|
||||
|
@ -166,7 +166,7 @@ fn gen_element_list(m: &Module, w: Writer) -> Result<()> {
|
||||
|
||||
for v in element {
|
||||
writeln!(w, "do")?;
|
||||
writeln!(w, "local target = TABLE_LIST[{}]", v.index())?;
|
||||
writeln!(w, "local target = TABLE_LIST[{}].data", v.index())?;
|
||||
writeln!(w, "local offset =")?;
|
||||
|
||||
gen_init_expression(v.offset().as_ref().unwrap().code(), w)?;
|
||||
|
Loading…
x
Reference in New Issue
Block a user