Back from the dyld: fix addr_main assignment.

When using the legacy technique, addr_main was being redifined. This
caused the access to addr_main outside the if statement to segfault.
This commit is contained in:
usiegl00
2022-09-30 06:46:45 +09:00
parent ce75cb2afc
commit 8aa01bfbcd
+1 -2
View File
@@ -699,7 +699,7 @@ int main(int argc, char** argv)
return 1;
}
void * addr_main = NSAddressOfSymbol_func(sym_main);
addr_main = NSAddressOfSymbol_func(sym_main);
if (!addr_main) {
return 1;
}
@@ -707,7 +707,6 @@ int main(int argc, char** argv)
#ifdef DEBUG
print("found main!\n");
#endif
};
int(*main_func)(int, char**) = (int(*)(int, char**))addr_main;
char* socket = (char*)(size_t)argc;