From f5afdf908033f667791df05c0fa800258ca9bb67 Mon Sep 17 00:00:00 2001 From: Jameson Nash Date: Wed, 19 Feb 2020 13:51:30 -0500 Subject: [PATCH] Profile: fix indent computation BoundsError (#34806) fixes #34723 --- stdlib/Profile/src/Profile.jl | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/stdlib/Profile/src/Profile.jl b/stdlib/Profile/src/Profile.jl index f484486ed29d7..1032429d96f5e 100644 --- a/stdlib/Profile/src/Profile.jl +++ b/stdlib/Profile/src/Profile.jl @@ -543,7 +543,9 @@ function indent(depth::Int) depth < 1 && return "" depth <= length(indent_z) && return indent_s[1:indent_z[depth]] div, rem = divrem(depth, length(indent_z)) - return (indent_s^div) * SubString(indent_s, 1, indent_z[rem]) + indent = indent_s^div + rem != 0 && (indent *= SubString(indent_s, 1, indent_z[rem])) + return indent end function tree_format(frames::Vector{<:StackFrameTree}, level::Int, cols::Int, maxes, filenamemap::Dict{Symbol,String}, showpointer::Bool)