mirror of
https://github.com/danog/ir.git
synced 2024-12-04 10:39:38 +01:00
Fixed support for forward declarations
This commit is contained in:
parent
0981d76cc7
commit
2c67a3ac86
@ -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 val = ir_strtab_count(&l->symtab) + 1;
|
||||||
ir_ref old_val = ir_strtab_lookup(&l->symtab, name, len, val);
|
ir_ref old_val = ir_strtab_lookup(&l->symtab, name, len, val);
|
||||||
if (old_val != 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;
|
return 0;
|
||||||
}
|
}
|
||||||
if (val >= l->sym_count) {
|
if (val >= l->sym_count) {
|
||||||
|
Loading…
Reference in New Issue
Block a user