Skip to content

Commit

Permalink
lj_vmprofile.c: Add assertions with lua_assert
Browse files Browse the repository at this point in the history
  • Loading branch information
lukego committed Nov 24, 2017
1 parent 0823d96 commit a8b0f32
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/lj_vmprofile.c
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,8 @@ static void vmprofile_signal(int sig, siginfo_t *si, void *data)
/* Handle overflow from individual trace counters. */
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);
lua_assert(vmstate >= 0 && vmstate <= LJ_VMST__MAX);
lua_assert(trace >= 0 && trace <= LJ_VMPROFILE_TRACE_MAX);
profile->count[trace][vmstate]++;
}
}
Expand Down

0 comments on commit a8b0f32

Please sign in to comment.