From d70cf314d88c46db89c59efc26e680f5c751af21 Mon Sep 17 00:00:00 2001 From: Norman Feske Date: Tue, 14 Jan 2020 22:58:48 +0100 Subject: [PATCH] Never throw in 'Attached_rom_dataspace::size' If the ROM service returned in invalid dataspace, reflect this condition via a size of zero instead of triggering an exception of type 'Reconstructible::Deref_unconstructed_object'. Issue #3606 --- repos/base/include/base/attached_rom_dataspace.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/repos/base/include/base/attached_rom_dataspace.h b/repos/base/include/base/attached_rom_dataspace.h index ffa51a844..7830976c5 100644 --- a/repos/base/include/base/attached_rom_dataspace.h +++ b/repos/base/include/base/attached_rom_dataspace.h @@ -85,7 +85,7 @@ class Genode::Attached_rom_dataspace template T const *local_addr() const { return _ds->local_addr(); } - size_t size() const { return _ds->size(); } + size_t size() const { return _ds.constructed() ? _ds->size() : 0; } /** * Register signal handler for ROM module changes