| 933 | } |
| 934 | |
| 935 | void *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 | |
| 961 | void *asCContext::GetReturnObject() |
| 962 | { |