Skip to content

Commit

Permalink
Fix error when code has no debug info
Browse files Browse the repository at this point in the history
  • Loading branch information
yuxiaomao committed Oct 29, 2024
1 parent 51e0035 commit 6ff1cb5
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/jit.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/module.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 6ff1cb5

Please sign in to comment.