Skip to content

Commit 1c6cd9b

Browse files
authored
fix a bug , we inc number of inst without checking if inst is null (gpgpu-sim#114)
1 parent 8124cbb commit 1c6cd9b

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/gpgpu-sim/shader.cc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -891,9 +891,9 @@ void shader_core_ctx::decode() {
891891
// decode 1 or 2 instructions and place them into ibuffer
892892
address_type pc = m_inst_fetch_buffer.m_pc;
893893
const warp_inst_t *pI1 = get_next_inst(m_inst_fetch_buffer.m_warp_id, pc);
894-
m_warp[m_inst_fetch_buffer.m_warp_id]->ibuffer_fill(0, pI1);
895-
m_warp[m_inst_fetch_buffer.m_warp_id]->inc_inst_in_pipeline();
896-
if (pI1) {
894+
if (pI1) {
895+
m_warp[m_inst_fetch_buffer.m_warp_id]->ibuffer_fill(0, pI1);
896+
m_warp[m_inst_fetch_buffer.m_warp_id]->inc_inst_in_pipeline();
897897
m_stats->m_num_decoded_insn[m_sid]++;
898898
if ((pI1->oprnd_type == INT_OP) ||
899899
(pI1->oprnd_type == UN_OP)) { // these counters get added up in mcPat

0 commit comments

Comments
 (0)