Skip to content

Commit

Permalink
fix one more UB case
Browse files Browse the repository at this point in the history
  • Loading branch information
AshesITR committed Jun 24, 2024
1 parent 9293f63 commit 9bb07f5
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/integrate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,9 @@ Rcpp::List do_integrate_gk(const Rcpp::Function fun, const arma::vec& lower, con
info = new arma::cube();
}
arma::vec res(lower.n_elem, arma::fill::zeros);
integrate_impl(fun, lower, upper, params, tolerance, max_iter, res, *info);
if (lower.n_elem > 0) {
integrate_impl(fun, lower, upper, params, tolerance, max_iter, res, *info);
}

Rcpp::NumericVector r_res = Rcpp::wrap(res);
r_res.attr("dim") = R_NilValue;
Expand Down

0 comments on commit 9bb07f5

Please sign in to comment.