IPluginFunction implementation is re-entrant across native calls, as heap allocations are delayed until execution

removed ICallable::GetAddressOfPushedParam
removed phys_addr from ICallable::PushArray
fixed a bug where sp_context_t::n_idx was overwritten upon re-entrant calls

--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%40595
This commit is contained in:
David Anderson
2007-03-10 21:02:40 +00:00
parent f592744d87
commit 38c94838b9
8 changed files with 137 additions and 124 deletions
+2 -7
View File
@@ -299,7 +299,7 @@ int CForward::Execute(cell_t *result, IForwardFilter *filter)
} else if (type == Param_Float || type == Param_Cell) {
func->PushCellByRef(&param->val);
} else {
func->PushArray(param->byref.orig_addr, param->byref.cells, NULL, param->byref.flags);
func->PushArray(param->byref.orig_addr, param->byref.cells, param->byref.flags);
assert(type == Param_Array || type == Param_FloatByRef || type == Param_CellByRef);
}
} else {
@@ -489,7 +489,7 @@ void CForward::_Int_PushArray(cell_t *inarray, unsigned int cells, int flags)
m_params[m_curparam].byref.orig_addr = inarray;
}
int CForward::PushArray(cell_t *inarray, unsigned int cells, cell_t **phys_addr, int flags)
int CForward::PushArray(cell_t *inarray, unsigned int cells, int flags)
{
/* We don't allow this here */
if (!inarray)
@@ -513,11 +513,6 @@ int CForward::PushArray(cell_t *inarray, unsigned int cells, cell_t **phys_addr,
m_params[m_curparam].pushedas = Param_Array;
}
if (phys_addr)
{
*phys_addr = NULL;
}
_Int_PushArray(inarray, cells, flags);
m_curparam++;
+1 -1
View File
@@ -50,7 +50,7 @@ public: //ICallable
virtual int PushCellByRef(cell_t *cell, int flags);
virtual int PushFloat(float number);
virtual int PushFloatByRef(float *number, int flags);
virtual int PushArray(cell_t *inarray, unsigned int cells, cell_t **phys_addr, int flags);
virtual int PushArray(cell_t *inarray, unsigned int cells, int flags);
virtual int PushString(const char *string);
virtual int PushStringEx(char *buffer, size_t length, int sz_flags, int cp_flags);
virtual void Cancel();