Skip to content

Commit

Permalink
PR feedback. Add default constructors.
Browse files Browse the repository at this point in the history
  • Loading branch information
lihasgupta committed Sep 20, 2023
1 parent e1c348d commit 5bd7105
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
5 changes: 2 additions & 3 deletions clients/drcachesim/tools/invariant_checker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -515,7 +515,7 @@ invariant_checker_t::parallel_shard_memref(void *shard_data, const memref_t &mem
!shard->expect_syscall_marker_,
"Syscall marker missing after syscall instruction");

per_shard_t::instr_info_t cur_instr_info = {};
per_shard_t::instr_info_t cur_instr_info;
const bool expect_encoding =
TESTANY(OFFLINE_FILE_TYPE_ENCODINGS, shard->file_type_);
if (expect_encoding) {
Expand All @@ -533,7 +533,6 @@ invariant_checker_t::parallel_shard_memref(void *shard_data, const memref_t &mem
instr_t *noalloc_instr = instr_from_noalloc(&noalloc);
decode_from_copy(drcontext_, const_cast<app_pc>(memref.instr.encoding),
trace_pc, noalloc_instr);

// Add decoding attributes to cur_instr_info.
if (noalloc_instr != nullptr) {
cur_instr_info.decoding.has_valid_decoding = true;
Expand Down Expand Up @@ -786,7 +785,7 @@ invariant_checker_t::parallel_shard_memref(void *shard_data, const memref_t &mem
// XXX i#3937: Online traces do not place signal markers properly,
// so we can't precisely check for continuity there.
knob_offline_) {
per_shard_t::instr_info_t instr_info {};
per_shard_t::instr_info_t instr_info;
instr_info.memref = memref;
// Ensure no discontinuity between a prior instr and the interrupted
// PC, for non-rseq signals where we have the interrupted PC.
Expand Down
10 changes: 5 additions & 5 deletions clients/drcachesim/tools/invariant_checker.h
Original file line number Diff line number Diff line change
Expand Up @@ -140,15 +140,15 @@ class invariant_checker_t : public analysis_tool_t {
bool is_predicated = false;
uint num_memory_read_access = 0;
uint num_memory_write_access = 0;
addr_t branch_target;
addr_t branch_target = 0;
};
struct instr_info_t {
memref_t memref;
decoding_info_t decoding;
memref_t memref = {};
decoding_info_t decoding = {};
};
std::unordered_map<app_pc, decoding_info_t> decode_cache_;
// On UNIX generally last_instr_in_cur_context_ should be used instead.
instr_info_t prev_instr_ = {};
instr_info_t prev_instr_;
#ifdef UNIX
// We keep track of some state per nested signal depth.
struct signal_context {
Expand All @@ -170,7 +170,7 @@ class invariant_checker_t : public analysis_tool_t {

// For the outer-most scope, like other nested signal scopes, we start with an
// empty memref_t to denote absence of any pre-signal instr.
instr_info_t last_instr_in_cur_context_ = {};
instr_info_t last_instr_in_cur_context_;

bool saw_rseq_abort_ = false;
// These are only available via annotations in signal_invariants.cpp.
Expand Down

0 comments on commit 5bd7105

Please sign in to comment.