Use automatic allocation for section data

This commit is contained in:
Rangi42
2024-02-28 20:54:33 -05:00
committed by Sylvie
parent 8fe6be19f1
commit 96f354026a
6 changed files with 16 additions and 40 deletions

View File

@@ -466,7 +466,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 {
@@ -486,7 +486,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;
}
}