Skip to content

Commit

Permalink
Also patch for instructions
Browse files Browse the repository at this point in the history
  • Loading branch information
malcolmstill committed Jul 23, 2023
1 parent f70b9c5 commit 779d9c4
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/module/parser.zig
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ pub const Parser = struct {

// Patch last end so that it is return
self.module.parsed_code.items[self.module.parsed_code.items.len - 1] = .@"return";
self.module.instructions.items[self.module.instructions.items.len - 1] = VirtualMachine.@"return";

return Parsed{ .start = code_start, .max_depth = self.validator.max_depth };
}
Expand Down Expand Up @@ -111,6 +112,7 @@ pub const Parser = struct {

// Patch last end so that it is return
self.module.parsed_code.items[self.module.parsed_code.items.len - 1] = .@"return";
self.module.instructions.items[self.module.instructions.items.len - 1] = VirtualMachine.@"return";

return Parsed{ .start = code_start, .max_depth = self.validator.max_depth };
}
Expand Down

0 comments on commit 779d9c4

Please sign in to comment.