mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-28 14:24:45 +00:00
function must end with an End instruction
This commit is contained in:
parent
ff29b19338
commit
08e242967a
1 changed files with 5 additions and 1 deletions
|
@ -120,11 +120,15 @@ impl<'a> WasmBackend<'a> {
|
|||
.with_result(self.ret_type)
|
||||
.build_sig();
|
||||
|
||||
// functions must end with an End instruction/opcode
|
||||
let mut instructions = self.instructions.clone();
|
||||
instructions.push(Instruction::End);
|
||||
|
||||
let function_def = builder::function()
|
||||
.with_signature(signature)
|
||||
.body()
|
||||
.with_locals(self.locals.clone())
|
||||
.with_instructions(Instructions::new(self.instructions.clone()))
|
||||
.with_instructions(Instructions::new(instructions))
|
||||
.build() // body
|
||||
.build(); // function
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue