diff --git a/clients/drcachesim/tracer/instru.cpp b/clients/drcachesim/tracer/instru.cpp index d3f7a223813..9f7bbedabc8 100644 --- a/clients/drcachesim/tracer/instru.cpp +++ b/clients/drcachesim/tracer/instru.cpp @@ -279,8 +279,8 @@ instru_t::insert_obtain_addr(void *drcontext, instrlist_t *ilist, instr_t *where dr_fprintf(STDERR, "\n"); DR_ASSERT(ok); } - if (scratch_used != NULL && we_used_scratch) - *scratch_used = true; + if (scratch_used != NULL) + *scratch_used = we_used_scratch; } // Returns -1 on error. It's hard for callers to omit the cpu marker though diff --git a/clients/drcachesim/tracer/instru_offline.cpp b/clients/drcachesim/tracer/instru_offline.cpp index bc92db6ca6f..2d129f0c830 100644 --- a/clients/drcachesim/tracer/instru_offline.cpp +++ b/clients/drcachesim/tracer/instru_offline.cpp @@ -478,7 +478,7 @@ offline_instru_t::insert_save_addr(void *drcontext, instrlist_t *ilist, instr_t res = drreg_reserve_register(drcontext, ilist, where, reg_vector_, ®_addr); DR_ASSERT(res == DRREG_SUCCESS); // Can't recover. reserved = true; - bool reg_ptr_used; + bool reg_ptr_used = false; insert_obtain_addr(drcontext, ilist, where, reg_addr, reg_ptr, ref, ®_ptr_used); if (reg_ptr_used) {