MCPcopy Create free account
hub / github.com/anjo76/angelscript / GetReturnObject

Method GetReturnObject

sdk/angelscript/source/as_context.cpp:961–985  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

959}
960
961void *asCContext::GetReturnObject()
962{
963 if( m_status != asEXECUTION_FINISHED ) return 0;
964
965 asCDataType *dt = &m_initialFunction->returnType;
966
967 if( !dt->IsObject() && !dt->IsFuncdef() ) return 0;
968
969 if( dt->IsReference() )
970 return *(void**)(asPWORD)m_regs.valueRegister;
971 else
972 {
973 if( m_initialFunction->DoesReturnOnStack() )
974 {
975 // The address of the return value was passed as the first argument, after the object pointer
976 int offset = 0;
977 if( m_initialFunction->objectType )
978 offset += AS_PTR_SIZE;
979
980 return *(void**)(&m_regs.stackFramePointer[offset]);
981 }
982
983 return m_regs.objectRegister;
984 }
985}
986
987void *asCContext::GetAddressOfReturnValue()
988{

Callers 5

TestFunction · 0.80
test_vector3.cppFile · 0.80
TestFunction · 0.80
TestFunction · 0.80
TestFunction · 0.80

Calls 4

IsObjectMethod · 0.80
IsFuncdefMethod · 0.80
DoesReturnOnStackMethod · 0.80
IsReferenceMethod · 0.45

Tested by 4

TestFunction · 0.64
TestFunction · 0.64
TestFunction · 0.64
TestFunction · 0.64