base: throw exception on cap-ref-count overflow

Ref #2120
This commit is contained in:
Martin Stein 2016-11-14 15:33:38 +01:00 committed by Christian Helmuth
parent 00adca8c47
commit 288c2c50ba
2 changed files with 4 additions and 1 deletions

View File

@ -16,6 +16,7 @@
#include <base/stdint.h>
#include <base/output.h>
#include <base/exception.h>
namespace Genode { class Native_capability; }
@ -24,6 +25,8 @@ class Genode::Native_capability
{
public:
struct Reference_count_overflow : Exception { };
/*
* Platform-specific raw information of the capability that is
* transferred as-is when the capability is delegated.

View File

@ -176,7 +176,7 @@ class Genode::Capability_space_tpl
Lock::Guard guard(_lock);
if (data.inc_ref() == 255)
error("cap ref count overflow");
throw Native_capability::Reference_count_overflow();
}
Rpc_obj_key rpc_obj_key(Data const &data) const