mirror of
https://github.com/genodelabs/genode.git
synced 2025-02-20 17:52:52 +00:00
libc: Dont't use local_addr in try/catch block.
The code in Libc::Cloned_malloc_heap_range initializes its local_addr member variable by calling Region_map::attach_at. This function can throw Region_conflict exception. The handler for this exception uses the local_addr to produce an error message. Such error log is IHMO useless, or even incorrect since the value of local_addr is undefined in such case. Its also worth noting that clang 12 produces the following warning for this code: "cannot refer to a non-static member from the handler of a constructor function try block" Issue #3985
This commit is contained in:
parent
c6d5b98227
commit
53081ac6b3
@ -40,7 +40,7 @@ struct Libc::Cloned_malloc_heap_range
|
||||
local_addr(rm.attach_at(ds, (addr_t)start))
|
||||
{ }
|
||||
catch (Region_map::Region_conflict) {
|
||||
error("could not clone heap region ", Hex_range(local_addr, size));
|
||||
error("could not clone heap region ", Hex_range((addr_t)start, size));
|
||||
throw;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user