check for code segments that exceed the bank size.

This commit is contained in:
Kelvin Sherlock 2019-12-17 12:43:37 -05:00
parent 5269b58365
commit 67f34936c2
1 changed files with 5 additions and 0 deletions

View File

@ -506,6 +506,11 @@ static void resolve(void) {
auto &seg = segments[ix];
auto &pending = relocations[ix];
if ((seg.kind & 0x0001) == 0x0001 && seg.data.size() > 65535) {
throw std::runtime_error("code exceeds bank");
}
for (auto &r : pending) {
assert(r.id < symbol_map.size());
const auto &e = symbol_table[r.id];