Skip to content

Commit

Permalink
Merge pull request #97 from 456Xander/fix_empty_trace
Browse files Browse the repository at this point in the history
Fix crash when writing empty trace files with debug assertions on
lmailletcontoz authored Oct 22, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
2 parents ed0d219 + 2739e55 commit f642423
Showing 2 changed files with 4 additions and 6 deletions.
5 changes: 2 additions & 3 deletions src/sysc/tracing/sc_vcd_trace.cpp
Original file line number Diff line number Diff line change
@@ -1374,9 +1374,8 @@ vcd_trace_file::cycle(bool this_is_a_delta_cycle)

// Now do the actual printing
bool time_printed = false;
vcd_trace* const* const l_traces = &traces[0];
for (int i = 0; i < (int)traces.size(); i++) {
vcd_trace* t = l_traces[i];
for (size_t i = 0; i < traces.size(); i++) {
vcd_trace* t = traces[i];
if(t->changed()) {
if(!time_printed){
print_time_stamp(now_units_high, now_units_low);
5 changes: 2 additions & 3 deletions src/sysc/tracing/sc_wif_trace.cpp
Original file line number Diff line number Diff line change
@@ -1226,9 +1226,8 @@ wif_trace_file::cycle(bool this_is_a_delta_cycle)
}

bool time_printed = false;
wif_trace* const* const l_traces = &traces[0];
for (int i = 0; i < (int)traces.size(); i++) {
wif_trace* t = l_traces[i];
for (size_t i = 0; i < traces.size(); i++) {
wif_trace* t = traces[i];
if(t->changed()){
if(time_printed == false) {

0 comments on commit f642423

Please sign in to comment.