diff --git a/Project.toml b/Project.toml index 3575f62a1..8a29d61e3 100644 --- a/Project.toml +++ b/Project.toml @@ -40,7 +40,7 @@ SafeTestsets = "0" SciMLBase = "1.8" Setfield = "0.7" SpecialFunctions = "0.7, 0.8, 0.9, 0.10, 1.0" -SymbolicUtils = "0.9.0, 0.10" +SymbolicUtils = "0.10.1" TreeViews = "0.3" julia = "1.5" diff --git a/src/build_function.jl b/src/build_function.jl index e199314a5..32c344476 100644 --- a/src/build_function.jl +++ b/src/build_function.jl @@ -78,8 +78,8 @@ end # Scalar output -destructure_arg(arg::Union{AbstractArray, Tuple}) = DestructuredArgs(map(value, arg)) -destructure_arg(arg) = arg +destructure_arg(arg::Union{AbstractArray, Tuple}, inbounds) = DestructuredArgs(map(value, arg), inbounds=inbounds) +destructure_arg(arg, _) = arg function _build_function(target::JuliaTarget, op, args...; conv = toexpr, @@ -88,7 +88,7 @@ function _build_function(target::JuliaTarget, op, args...; checkbounds = false, linenumbers = true) - dargs = map(destructure_arg, [args...]) + dargs = map(arg -> destructure_arg(arg, !checkbounds), [args...]) expr = toexpr(Func(dargs, [], unflatten_long_ops(op))) if expression == Val{true} @@ -185,7 +185,7 @@ function _build_function(target::JuliaTarget, rhss::AbstractArray, args...; fillzeros = skipzeros && !(typeof(rhss)<:SparseMatrixCSC), parallel=SerialForm(), kwargs...) - dargs = map(destructure_arg, [args...]) + dargs = map(arg -> destructure_arg(arg, !checkbounds), [args...]) i = findfirst(x->x isa DestructuredArgs, dargs) similarto = i === nothing ? Array : dargs[i].name oop_expr = Func(dargs, [], make_array(parallel, dargs, rhss, similarto))