Skip to content

Commit

Permalink
Fixed support for forward declarations
Browse files Browse the repository at this point in the history
  • Loading branch information
dstogov committed Dec 6, 2023
1 parent 0981d76 commit 2c67a3a
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions ir_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,11 @@ static bool ir_loader_add_sym(ir_loader *loader, const char *name, void *addr)
ir_ref val = ir_strtab_count(&l->symtab) + 1;
ir_ref old_val = ir_strtab_lookup(&l->symtab, name, len, val);
if (old_val != val) {
if (addr && !l->sym[old_val].addr) {
/* Update forward declaration */
l->sym[old_val].addr = addr;
return 1;
}
return 0;
}
if (val >= l->sym_count) {
Expand Down

0 comments on commit 2c67a3a

Please sign in to comment.