Repository: JuliaLang/julia
File: base/util.jl (Julia)

Code before:
    elseif opts.malloc_log == 3
        push!(addflags, "--track-allocation=@$(unsafe_string(opts.tracked_path))")
    end
    if opts.color == 1
        push!(addflags, "--color=yes")
    elseif opts.color == 2
        push!(addflags, "--color=no")
    end
    if opts.startupfile == 2
        push!(addflags, "--startup-file=no")
    end
    if opts.use_sysimage_native_code == 0
        push!(addflags, "--sysimage-native-code=no")
    end
    if opts.compress_sysimage == 1
        push!(addflags, "--compress-sysimage=yes")
    end
    if opts.target_sanitize_memory == 1
        push!(addflags, "--target-sanitize=memory")
    end
    if opts.target_sanitize_thread == 1
        push!(addflags, "--target-sanitize=thread")
    end
    if opts.target_sanitize_address == 1
        push!(addflags, "--target-sanitize=address")
    end
    return `$julia -C $cpu_target -J$image_file $addflags`
end

function julia_exename()
    if !isdebugbuild()
        return @static Sys.iswindows() ? "julia.exe" : "julia"
    else
        return @static Sys.iswindows() ? "julia-debug.exe" : "julia-debug"
    end
end

"""
    securezero!(o)

`securezero!` fills the memory associated with an object `o` with zeros.
Unlike `fill!(o,0)` and similar code, which might be optimized away by
the compiler for objects about to be discarded, the `securezero!` function
will always be called.
"""
function securezero! end
@noinline securezero!(a::AbstractArray{<:Number}) = fill!(a, 0)
@noinline unsafe_securezero!(p::Ptr{T}, len::Integer=1) where {T} =
    memset(p, 0, len*sizeof(T))
unsafe_securezero!(p::Ptr{Cvoid}, len::Integer=1) = Ptr{Cvoid}(unsafe_securezero!(Ptr{UInt8}(p), len))


Review comment (suggestion):
I don't believe we propagate any flags related to `--output` (why would we?)
```suggestion
```

Code after:
    elseif opts.malloc_log == 3
        push!(addflags, "--track-allocation=@$(unsafe_string(opts.tracked_path))")
    end
    if opts.color == 1
        push!(addflags, "--color=yes")
    elseif opts.color == 2
        push!(addflags, "--color=no")
    end
    if opts.startupfile == 2
        push!(addflags, "--startup-file=no")
    end
    if opts.use_sysimage_native_code == 0
        push!(addflags, "--sysimage-native-code=no")
    end
    if opts.compress_sysimage == 1
        push!(addflags, "--compress-sysimage=yes")
    end
    return `$julia -C $cpu_target -J$image_file $addflags`
end

function julia_exename()
    if !isdebugbuild()
        return @static Sys.iswindows() ? "julia.exe" : "julia"
    else
        return @static Sys.iswindows() ? "julia-debug.exe" : "julia-debug"
    end
end

"""
    securezero!(o)

`securezero!` fills the memory associated with an object `o` with zeros.
Unlike `fill!(o,0)` and similar code, which might be optimized away by
the compiler for objects about to be discarded, the `securezero!` function
will always be called.
"""
function securezero! end
@noinline securezero!(a::AbstractArray{<:Number}) = fill!(a, 0)
@noinline unsafe_securezero!(p::Ptr{T}, len::Integer=1) where {T} =
    memset(p, 0, len*sizeof(T))
unsafe_securezero!(p::Ptr{Cvoid}, len::Integer=1) = Ptr{Cvoid}(unsafe_securezero!(Ptr{UInt8}(p), len))

"""
    Base.getpass(message::AbstractString; with_suffix::Bool=true)::Base.SecretBuffer

Display a message and wait for the user to input a secret, returning an `IO`
object containing the secret. If `with_suffix` is `true` (the default), the
suffix `": "` will be appended to `message`.

!!! info "Windows"
    Note that on Windows, the secret might be displayed as it is typed; see