Former-commit-id: ceef4402d40f701b0527eee038f9f4e5abe3fb70
This commit is contained in:
Jarred Sumner
2021-08-02 23:07:09 -07:00
parent 81f9e0b9e6
commit 3ee7467d66
2 changed files with 4 additions and 14 deletions

View File

@@ -537,19 +537,9 @@ pub const VirtualMachine = struct {
// We are going to print the stack trace backwards
const stack = trace.frames();
if (stack.len > 0) {
var i = @intCast(i16, stack.len - 1);
var i: i16 = 0;
var func_name_pad: usize = 0;
while (i >= 0) : (i -= 1) {
const frame = stack[@intCast(usize, i)];
func_name_pad = std.math.max(func_name_pad, std.fmt.count("{any}", .{
frame.nameFormatter(allow_ansi_colors),
}));
}
i = @intCast(i16, stack.len - 1);
while (i >= 0) : (i -= 1) {
while (i < stack.len) : (i += 1) {
const frame = stack[@intCast(usize, i)];
const file = frame.source_url.slice();
const func = frame.function_name.slice();