Merge pull request #2299 from popcoder565/test/agc-unit-shadow-import-retire

test(agc-driver): retire the unit shadow block's import before releasing it
This commit is contained in:
Dean
2026-10-10 10:44:14 +13:00
committed by GitHub
@@ -1370,14 +1370,19 @@ void unitShadowTests(const Device& device, Recorder& recorder) {
mutation.Add(block, bytes, true, true);
}
struct Unregister {
const Context& context;
void* block;
std::uint64_t address;
bool armed = true;
~Unregister() {
if (!armed) return;
GuestAllocations::Mutation mutation;
mutation.Remove(block);
{
GuestAllocations::Mutation mutation;
mutation.Remove(block);
}
HostImportFor(context, address, bytes);
}
} unregister{block};
} unregister{context, block, address};
const auto* import = HostImportFor(context, address, bytes);
if (import == nullptr) {
std::cout << "host import of the shadow test block refused: unit shadows not tested\n";