mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-09-03 11:15:20 +02:00
Warning fixes, alignment checks
This commit is contained in:
@@ -1331,7 +1331,7 @@ static PSPModule *__KernelLoadELFFromPtr(const u8 *ptr, size_t elfSize, u32 load
|
||||
// Seen in WWE: Smackdown vs Raw 2009. See #17435.
|
||||
continue;
|
||||
}
|
||||
if (!Memory::IsValidRange(start, len)) {
|
||||
if (!Memory::IsValid4AlignedRange(start, len)) {
|
||||
ERROR_LOG(Log::Loader, "Bad section %08x (len %08x) of section %d", start, len, id);
|
||||
continue;
|
||||
}
|
||||
@@ -1351,7 +1351,7 @@ static PSPModule *__KernelLoadELFFromPtr(const u8 *ptr, size_t elfSize, u32 load
|
||||
u32 scanStart = module->textStart;
|
||||
u32 scanEnd = module->textEnd;
|
||||
|
||||
if (Memory::IsValidRange(scanStart, scanEnd - scanStart)) {
|
||||
if (Memory::IsValid4AlignedRange(scanStart, scanEnd - scanStart)) {
|
||||
// Skip the exports and imports sections, they're not code.
|
||||
if (scanEnd >= std::min(modinfo->libent, modinfo->libstub)) {
|
||||
insertSymbols = MIPSAnalyst::ScanForFunctions(scanStart, std::min(modinfo->libent, modinfo->libstub) - 4, insertSymbols);
|
||||
@@ -1473,6 +1473,11 @@ static PSPModule *__KernelLoadELFFromPtr(const u8 *ptr, size_t elfSize, u32 load
|
||||
u32 nid = residentPtr[ent->fcount + j];
|
||||
u32 exportAddr = exportPtr[ent->fcount + j];
|
||||
|
||||
if (exportAddr & 3) {
|
||||
ERROR_LOG(Log::Loader, "Bad export address %08x", exportAddr);
|
||||
continue;
|
||||
}
|
||||
|
||||
int size;
|
||||
switch (nid) {
|
||||
case NID_MODULE_INFO:
|
||||
|
||||
Reference in New Issue
Block a user