GP-0: Fixing Mach-O stub processing on blank symbols (Closes #8513)

This commit is contained in:
Ryan Kurtz 2025-09-22 09:21:15 -04:00
parent 78008fae1e
commit 1f0bd4a9e2

View file

@ -685,11 +685,11 @@ public class MachoProgramBuilder {
int symbolIndex = indirectSymbols.get(i); int symbolIndex = indirectSymbols.get(i);
NList symbol = symbolTableCommand.getSymbolAt(symbolIndex); NList symbol = symbolTableCommand.getSymbolAt(symbolIndex);
String name = null; String name = null;
if (symbol != null) { if (symbol != null && !symbol.getString().isBlank()) {
name = SymbolUtilities.replaceInvalidChars(symbol.getString(), true); name = SymbolUtilities.replaceInvalidChars(symbol.getString(), true);
} }
Function stubFunc = createOneByteFunction(program, name, startAddr); Function stubFunc = createOneByteFunction(program, name, startAddr);
if (stubFunc != null && symbol != null) { if (stubFunc != null && name != null) {
ExternalLocation loc = program.getExternalManager() ExternalLocation loc = program.getExternalManager()
.addExtLocation(Library.UNKNOWN, name, null, SourceType.IMPORTED); .addExtLocation(Library.UNKNOWN, name, null, SourceType.IMPORTED);
stubFunc.setThunkedFunction(loc.createFunction()); stubFunc.setThunkedFunction(loc.createFunction());