@@ -4417,7 +4417,7 @@ int hl_jit_function( jit_ctx *ctx, hl_module *m, hl_function *f ) {
r->lock = 0;
}
// save debug infos
- {
+ if( ctx->debug ) {
int fid = (int)(f - m->code->functions);
ctx->debug[fid].start = codePos;
ctx->debug[fid].offsets = debug32 ? (void*)debug32 : (void*)debug16;
@@ -476,7 +476,7 @@ static void hl_module_init_indexes( hl_module *m ) {
#include <jitprofiling.h>
h_bool hl_module_init_vtune( hl_module *m ) {
int i;
- if( !iJIT_IsProfilingActive() )
+ if( !iJIT_IsProfilingActive() || m->jit_debug == NULL )
return false;
for(i=0;i<m->code->nfunctions;i++) {
hl_function *f = m->code->functions + i;