noux: calculate rm::attach parameters correctly

Previous commit denies the creation of regions larger then the dataspace.
Noux does it by setting the default size to the dataspace size without
subtracting the offset.

Fixes #591
This commit is contained in:
Alexander Boettcher 2013-07-29 14:18:14 +02:00 committed by Norman Feske
parent 717be91e16
commit 01d267e551
1 changed files with 6 additions and 3 deletions

View File

@ -189,8 +189,11 @@ namespace Noux {
Local_addr local_addr = (addr_t)0,
bool executable = false)
{
if (size == 0)
size = Dataspace_client(ds).size();
/*
* Rm_session substracts offset from size if size is 0
*/
if (size == 0)
size = Dataspace_client(ds).size() - offset;
/*
* XXX look if we can identify the specified dataspace.
@ -202,7 +205,7 @@ namespace Noux {
executable);
/*
* Record attachement for later replay (needed during
* Record attachment for later replay (needed during
* fork)
*/
_regions.insert(new (env()->heap())