Skip to content

Commit

Permalink
lj_vmprofile.c: Fix trace number overflow (into bucket 0)
Browse files Browse the repository at this point in the history
  • Loading branch information
lukego committed Nov 24, 2017
1 parent ae5c6aa commit 0823d96
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/lj_vmprofile.c
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ static void vmprofile_signal(int sig, siginfo_t *si, void *data)
}
}
/* Handle overflow from individual trace counters. */
trace = trace <= LJ_VMPROFILE_TRACE_MAX ? trace : LJ_VMPROFILE_TRACE_MAX+1;
trace = trace <= LJ_VMPROFILE_TRACE_MAX ? trace : 0;
/* Phew! We have calculated the indices and now we can bump the counter. */
assert(vmstate >= 0 && vmstate <= LJ_VMST__MAX);
profile->count[trace][vmstate]++;
Expand Down

0 comments on commit 0823d96

Please sign in to comment.