[qfcc] Fix infinite loop in linker

This commit is contained in:
Bill Currie 2020-02-29 20:13:25 +09:00
parent 8b6d05a4dd
commit e93ca9d828

View file

@ -1122,12 +1122,11 @@ undefined_def (qfo_def_t *def)
if (func->code < 0) { if (func->code < 0) {
continue; continue;
} }
if ((pr_uint_t) func->code > reloc->offset) { if ((pr_uint_t) func->code <= reloc->offset) {
continue; if (!best || reloc->offset - func->code < best_dist) {
} best = func;
if (!best || reloc->offset - func->code < best_dist) { best_dist = reloc->offset - func->code;
best = func; }
best_dist = reloc->offset - func->code;
} }
func++; func++;
} }