Skip to content

Commit 8b05d84

Browse files
committed
Use ordered map for commit log
In general, unordered maps should not be used for iteration, only for lookups. In this case, using an ordered map guarantees that the order in which writes are logged is consistent for a given instruction. Resolves #1499
1 parent 91793ed commit 8b05d84

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

riscv/processor.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ struct insn_desc_t
6262
};
6363

6464
// regnum, data
65-
typedef std::unordered_map<reg_t, freg_t> commit_log_reg_t;
65+
typedef std::map<reg_t, freg_t> commit_log_reg_t;
6666

6767
// addr, value, size
6868
typedef std::vector<std::tuple<reg_t, uint64_t, uint8_t>> commit_log_mem_t;

0 commit comments

Comments
 (0)