simulator crash fix #101

(cherry picked from commit fd98124304)
This commit is contained in:
Matthew Kennedy 2023-05-05 14:53:39 -07:00 committed by rusefillc
parent 1caeaeafda
commit 16e1a42ef3
1 changed files with 4 additions and 1 deletions

View File

@ -17,6 +17,7 @@
#include "pch.h"
#include "chprintf.h"
#include "rusEfiFunctionalTest.h"
#include "flash_int.h"
#include <iostream>
#include <filesystem>
@ -213,11 +214,13 @@ static std::string makeFileName(flashaddr_t addr) {
return ss.str();
}
int intFlashErase(flashaddr_t address, size_t size) {
int intFlashErase(flashaddr_t address, size_t) {
// Try to delete the file, swallow any errors (we can overwrite it anyway)
try {
std::filesystem::remove(makeFileName(address));
} catch (...) { }
return FLASH_RETURN_SUCCESS;
}
int intFlashRead(flashaddr_t address, char* buffer, size_t size) {