File tree Expand file tree Collapse file tree 1 file changed +21
-1
lines changed Expand file tree Collapse file tree 1 file changed +21
-1
lines changed Original file line number Diff line number Diff line change @@ -629,7 +629,15 @@ function build_explicit_observed_function(sys, ts;
629
629
oop_fn = Func (args, [],
630
630
pre (Let (obsexprs,
631
631
return_value,
632
- false ))) |> array_wrapper[1 ] |> oop_mtkp_wrapper |> toexpr
632
+ false )), [Expr (:meta , :propagate_inbounds )]) |> array_wrapper[1 ] |> oop_mtkp_wrapper |> toexpr
633
+
634
+ if ! checkbounds
635
+ oop_fn. args[end ] = quote
636
+ @inbounds begin
637
+ $ (oop_fn. args[end ])
638
+ end
639
+ end
640
+ end
633
641
oop_fn = expression ? oop_fn : eval_or_rgf (oop_fn; eval_expression, eval_module)
634
642
635
643
if ! isscalar
@@ -639,6 +647,18 @@ function build_explicit_observed_function(sys, ts;
639
647
wrap_code = mtkparams_wrapper .∘ array_wrapper .∘
640
648
wrap_assignments (isscalar, obsexprs),
641
649
expression = Val{true })[2 ]
650
+ if ! checkbounds
651
+ iip_fn. args[end ] = quote
652
+ @inbounds begin
653
+ $ (iip_fn. args[end ])
654
+ end
655
+ end
656
+ end
657
+ iip_fn. args[end ] = quote
658
+ $ (Expr (:meta , :propagate_inbounds ))
659
+ $ (iip_fn. args[end ])
660
+ end
661
+
642
662
if ! expression
643
663
iip_fn = eval_or_rgf (iip_fn; eval_expression, eval_module)
644
664
end
You can’t perform that action at this time.
0 commit comments