Use std::vector for section data

This commit is contained in:
Rangi42
2024-02-27 14:54:00 -05:00
committed by Sylvie
parent 4cd88ade54
commit 52ac98c294
6 changed files with 19 additions and 32 deletions

View File

@@ -467,7 +467,7 @@ static void applyFilePatches(struct Section *section, struct Section *dataSectio
error(patch.src, patch.lineNo,
"jr target out of reach (expected -129 < %" PRId16 " < 128)",
jumpOffset);
dataSection->data[offset] = jumpOffset & 0xFF;
(*dataSection->data)[offset] = jumpOffset & 0xFF;
} else {
// Patch a certain number of bytes
struct {
@@ -487,7 +487,7 @@ static void applyFilePatches(struct Section *section, struct Section *dataSectio
value, value < 0 ? " (maybe negative?)" : "",
types[patch.type].size * 8U);
for (uint8_t i = 0; i < types[patch.type].size; i++) {
dataSection->data[offset + i] = value & 0xFF;
(*dataSection->data)[offset + i] = value & 0xFF;
value >>= 8;
}
}