| 722 | } |
| 723 | |
| 724 | int asCContext::SetObject(void *obj) |
| 725 | { |
| 726 | if( m_status != asEXECUTION_PREPARED ) |
| 727 | return asCONTEXT_NOT_PREPARED; |
| 728 | |
| 729 | if( !m_initialFunction->objectType ) |
| 730 | { |
| 731 | m_status = asEXECUTION_ERROR; |
| 732 | return asERROR; |
| 733 | } |
| 734 | |
| 735 | asASSERT( *(asPWORD*)&m_regs.stackFramePointer[0] == 0 ); |
| 736 | |
| 737 | *(asPWORD*)&m_regs.stackFramePointer[0] = (asPWORD)obj; |
| 738 | |
| 739 | // TODO: This should be optional by having a flag where the application can chose whether it should be done or not |
| 740 | // The flag could be named something like takeOwnership and have default value of true |
| 741 | if( obj && (m_initialFunction->objectType->flags & asOBJ_SCRIPT_OBJECT) ) |
| 742 | reinterpret_cast<asCScriptObject*>(obj)->AddRef(); |
| 743 | |
| 744 | return 0; |
| 745 | } |
| 746 | |
| 747 | int asCContext::SetArgByte(asUINT arg, asBYTE value) |
| 748 | { |
no test coverage detected