vfs: check userland buffers before reading them.
[haiku.git] / src / kits / debugger / model / ReturnValueInfo.cpp
blob3ae7bb27a080524434984c08937aae08f1b6691f
1 /*
2 * Copyright 2013, Rene Gollent, rene@gollent.com.
3 * Distributed under the terms of the MIT License.
4 */
7 #include "ReturnValueInfo.h"
9 #include "CpuState.h"
12 ReturnValueInfo::ReturnValueInfo()
14 BReferenceable(),
15 fAddress(0),
16 fState(NULL)
21 ReturnValueInfo::ReturnValueInfo(target_addr_t address, CpuState* state)
23 BReferenceable(),
24 fAddress(address),
25 fState(state)
27 state->AcquireReference();
31 ReturnValueInfo::~ReturnValueInfo()
33 if (fState != NULL)
34 fState->ReleaseReference();
38 void
39 ReturnValueInfo::SetTo(target_addr_t address, CpuState* state)
41 fAddress = address;
43 if (fState != NULL)
44 fState->ReleaseReference();
46 fState = state;
47 fState->AcquireReference();