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

Method GetReturnAddress

sdk/angelscript/source/as_context.cpp:935–959  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

933}
934
935void *asCContext::GetReturnAddress()
936{
937 if( m_status != asEXECUTION_FINISHED ) return 0;
938
939 asCDataType *dt = &m_initialFunction->returnType;
940
941 if( dt->IsReference() )
942 return *(void**)&m_regs.valueRegister;
943 else if( dt->IsObject() || dt->IsFuncdef() )
944 {
945 if( m_initialFunction->DoesReturnOnStack() )
946 {
947 // The address of the return value was passed as the first argument, after the object pointer
948 int offset = 0;
949 if( m_initialFunction->objectType )
950 offset += AS_PTR_SIZE;
951
952 return *(void**)(&m_regs.stackFramePointer[offset]);
953 }
954
955 return m_regs.objectRegister;
956 }
957
958 return 0;
959}
960
961void *asCContext::GetReturnObject()
962{

Callers 3

ScriptObjectCopyFactoryFunction · 0.80
TestFunction · 0.80

Calls 4

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

Tested by 1

TestFunction · 0.64