Skip to content

Commit

Permalink
fix stacktrace & misc tests
Browse files Browse the repository at this point in the history
  • Loading branch information
d-netto committed Mar 22, 2024
1 parent 637f64e commit f053663
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/ast.c
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ static value_t fl_current_module_counter(fl_context_t *fl_ctx, value_t *args, ui
}
// Create the string
char buf[(funcname != NULL ? strlen(funcname) : 0) + 20];
if (funcname != NULL && funcname[0] != '#') {
if (funcname != NULL && funcname[0] != '#' && !isdigit(funcname[strlen(funcname)-1])) {
uint32_t nxt;
uv_mutex_lock(&counter_table_lock);
// try to find the module name in the counter table, if it's not create a symbol table for it
Expand All @@ -250,7 +250,7 @@ static value_t fl_current_module_counter(fl_context_t *fl_ctx, value_t *args, ui
// to avoid the counter being 0 or 1, which are reserved
ptrhash_put(mod_table, funcname, (void*)(uintptr_t)((nxt + 1) << 2 | 3));
uv_mutex_unlock(&counter_table_lock);
snprintf(buf, sizeof(buf), "%s%d", funcname, nxt);
snprintf(buf, sizeof(buf), "<%s>%d", funcname, nxt);
}
else {
snprintf(buf, sizeof(buf), "%d", jl_module_next_counter(ctx->module));
Expand Down
2 changes: 1 addition & 1 deletion src/datatype.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ static jl_sym_t *jl_demangle_typename(jl_sym_t *s) JL_NOTSAFEPOINT
len = strlen(n) - 1;
else
len = (end-n) - 1; // extract `f` from `#f#...`
if (is10digit(n[1]) || is_anonfn_typename(n))
if (is10digit(n[1]) || (end != n && is10digit(end[-1])))
return _jl_symbol(n, len+1);
return _jl_symbol(&n[1], len);
}
Expand Down

0 comments on commit f053663

Please sign in to comment.