core/vm/sp_vm_basecontext.cpp
changeset 938 8e95112b2501
parent 790 9b1474d03470
child 1000 aefbd36eaf91
     1.1 --- a/core/vm/sp_vm_basecontext.cpp	Fri Jun 15 06:31:12 2007 +0000
     1.2 +++ b/core/vm/sp_vm_basecontext.cpp	Fri Jun 15 20:23:40 2007 +0000
     1.3 @@ -72,6 +72,17 @@
     1.4  	} else {
     1.5  		m_pub_funcs = NULL;
     1.6  	}
     1.7 +
     1.8 +	/* Initialize the null references */
     1.9 +	uint32_t index;
    1.10 +	if (FindPubvarByName("NULL_VECTOR", &index) == SP_ERROR_NONE)
    1.11 +	{
    1.12 +		sp_pubvar_t *pubvar;
    1.13 +		GetPubvarByIndex(index, &pubvar);
    1.14 +		m_pNullVec = pubvar->offs;
    1.15 +	} else {
    1.16 +		m_pNullVec = NULL;
    1.17 +	}
    1.18  }
    1.19  
    1.20  void BaseContext::FlushFunctionCache()
    1.21 @@ -991,4 +1002,14 @@
    1.22  {
    1.23  	m_pToken = token;
    1.24  }
    1.25 +
    1.26 +cell_t *BaseContext::GetNullRef(SP_NULL_TYPE type)
    1.27 +{
    1.28 +	if (type == SP_NULL_VECTOR)
    1.29 +	{
    1.30 +		return m_pNullVec;
    1.31 +	}
    1.32 +
    1.33 +	return NULL;
    1.34 +}
    1.35  #endif