From 10d322c97c804683bc8bb4fb6c50a5ec7a6d1d2a Mon Sep 17 00:00:00 2001 From: Michael Zingale Date: Fri, 26 Apr 2024 19:39:55 -0400 Subject: [PATCH] fix a copy of the mask in the reaction code highlighted by coverity --- Source/reactions/Castro_react.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Source/reactions/Castro_react.cpp b/Source/reactions/Castro_react.cpp index d3ff040048..f226cd62e5 100644 --- a/Source/reactions/Castro_react.cpp +++ b/Source/reactions/Castro_react.cpp @@ -203,7 +203,8 @@ Castro::react_state(MultiFab& s, MultiFab& r, Real time, Real dt, const int stra auto U = s.array(mfi); auto reactions = r.array(mfi); auto weights = store_burn_weights ? burn_weights.array(mfi) : Array4{}; - const auto mask = mask_covered_zones ? mask_mf.array(mfi) : Array4{}; + Array4 empty_arr{}; + const auto& mask = mask_covered_zones ? mask_mf.array(mfi) : empty_arr; const auto dx = geom.CellSizeArray(); #ifdef MODEL_PARSER @@ -550,7 +551,8 @@ Castro::react_state(Real time, Real dt) auto I = SDC_react.array(mfi); auto react_src = reactions.array(mfi); auto weights = store_burn_weights ? burn_weights.array(mfi) : Array4{}; - const auto mask = mask_covered_zones ? mask_mf.array(mfi) : Array4{}; + Array4 empty_arr{}; + const auto& mask = mask_covered_zones ? mask_mf.array(mfi) : empty_arr; int lsdc_iteration = sdc_iteration;