diff --git a/singularity-eos/eos/get_sg_eos_rho_e.cpp b/singularity-eos/eos/get_sg_eos_rho_e.cpp index 29a6516caf..e9fe4a3d0e 100644 --- a/singularity-eos/eos/get_sg_eos_rho_e.cpp +++ b/singularity-eos/eos/get_sg_eos_rho_e.cpp @@ -54,9 +54,9 @@ void get_sg_eos_rho_e(const char *name, int ncell, indirection_v &offsets_v, // eos accessor singularity::EOSAccessor_ eos_inx(eos_v, &pte_idxs(tid, 0)); // reset inputs - // JMM: Address sanitizer likes these named. My guess is - // that the forwarding references are not being resolved - // properly. + // JMM: The solver constructor is (deep under the hood) + // capturing by reference. So to avoid out-of-scope access, + // these must be "anchored" at caller scope. Real *prho_pte = &rho_pte(tid, 0); Real *pvfrac_pte = &vfrac_pte(tid, 0); Real *psie_pte = &sie_pte(tid, 0); diff --git a/singularity-eos/eos/get_sg_eos_rho_t.cpp b/singularity-eos/eos/get_sg_eos_rho_t.cpp index 692e76b409..f7bc3cf8b8 100644 --- a/singularity-eos/eos/get_sg_eos_rho_t.cpp +++ b/singularity-eos/eos/get_sg_eos_rho_t.cpp @@ -55,8 +55,9 @@ void get_sg_eos_rho_t(const char *name, int ncell, indirection_v &offsets_v, // create solver lambda // eos accessor singularity::EOSAccessor_ eos_inx(eos_v, &pte_idxs(tid, 0)); - // JMM: Address sanitizer does not like passing these in - // through the function call. + // JMM: The solver constructor is (deep under the hood) + // capturing by reference. So to avoid out-of-scope access, + // these must be "anchored" at caller scope. Real *prho_pte = &rho_pte(tid, 0); Real *pvfrac_pte = &vfrac_pte(tid, 0); Real *psie_pte = &sie_pte(tid, 0);