Don't break backwards compatibility with unmanaged forwards

Instead of adding new functions to `IForward`, we just allow NULL to be passed to `PushArray` and `PushString`.
This commit is contained in:
Peace-Maker
2017-08-25 23:23:50 +02:00
parent e609a33e6d
commit 7eef3948b1
4 changed files with 27 additions and 21 deletions
+15 -2
View File
@@ -528,10 +528,17 @@ void CForward::_Int_PushArray(cell_t *inarray, unsigned int cells, int flags)
int CForward::PushArray(cell_t *inarray, unsigned int cells, int flags)
{
/* We don't allow this here */
/* Push a reference to the NULL_VECTOR pubvar if NULL was passed. */
if (!inarray)
{
return SetError(SP_ERROR_PARAM);
/* Make sure this was intentional. */
if (cells == 3)
{
return PushNullVector();
} else {
/* We don't allow this here */
return SetError(SP_ERROR_PARAM);
}
}
if (m_curparam < m_numparams)
@@ -568,6 +575,12 @@ void CForward::_Int_PushString(cell_t *inarray, unsigned int cells, int sz_flags
int CForward::PushString(const char *string)
{
/* Push a reference to the NULL_STRING pubvar if NULL was passed. */
if (!string)
{
return PushNullString();
}
if (m_curparam < m_numparams)
{
if (m_types[m_curparam] == Param_Any)