Skip to content

Commit

Permalink
Set can_continue to false on fail
Browse files Browse the repository at this point in the history
  • Loading branch information
bgk- committed May 28, 2024
1 parent 2baa216 commit a839500
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/export.zig
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ export fn run(vm_ptr: usize) void {
var vm: *Vm = @ptrFromInt(vm_ptr);
vm.run() catch {
if (vm.err.msg) |msg| {
log("Error Line {d}: {s}", .{ vm.err.line, msg }, .err);
log("Error at line {}: {s}", .{ vm.err.line, msg }, .err);
}
};
}
Expand Down
1 change: 1 addition & 0 deletions src/vm.zig
Original file line number Diff line number Diff line change
Expand Up @@ -316,6 +316,7 @@ pub const Vm = struct {
fn fail(self: *Vm, comptime msg: []const u8, args: anytype) !void {
self.err.msg = try std.fmt.allocPrint(self.allocator, msg, args);
self.err.line = self.currentFrame().cl.data.closure.data.function.lines[self.currentFrame().ip];
self.can_continue = false;
return Error.RuntimeError;
}

Expand Down

0 comments on commit a839500

Please sign in to comment.