UltraPage: Write to concrete_data as a single block instead of loop (#6760)

This commit is contained in:
Kevin Phoenix 2026-08-04 10:11:26 -07:00 committed by GitHub
parent 4a9c1454dc
commit f4b23d4444
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -185,17 +185,16 @@ class UltraPage(MemoryObjectMixin, PageBase):
self.symbolic_bitmap.clear_range(addr, addr + size)
# store
arange = range(addr, addr + size)
ival = data if type(data) is int else data.object.args[0]
if endness == "Iend_BE":
arange = reversed(arange)
assert memory.state.arch.byte_width == 8
# TODO: Make UltraPage support architectures with greater byte_widths (but are still multiples of 8)
concrete_data = self._concrete()
for subaddr in arange:
concrete_data[subaddr] = ival & 0xFF
ival >>= 8
# Serialize in one step.
concrete_data[addr : addr + size] = (ival & ((1 << (size * 8)) - 1)).to_bytes(
size, "big" if endness == "Iend_BE" else "little"
)
else:
# mark range as symbolic
self.symbolic_bitmap.set_range(addr, addr + size)