From a8b0f320bb626af1955a0b3768976236e41f277f Mon Sep 17 00:00:00 2001 From: Luke Gorrie Date: Fri, 24 Nov 2017 08:42:36 +0000 Subject: [PATCH] lj_vmprofile.c: Add assertions with lua_assert --- src/lj_vmprofile.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/lj_vmprofile.c b/src/lj_vmprofile.c index e6b49888fb..eb2ef48792 100644 --- a/src/lj_vmprofile.c +++ b/src/lj_vmprofile.c @@ -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]++; } }