"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/libnxsl/vm.cpp" between
netxms-3.8.382.tar.gz and netxms-3.8.405.tar.gz

About: NetXMS is a multi-platform open source network management and monitoring system.

vm.cpp  (netxms-3.8.382):vm.cpp  (netxms-3.8.405)
skipping to change at line 419 skipping to change at line 419
else else
{ {
error(NXSL_ERR_NO_MAIN); error(NXSL_ERR_NO_MAIN);
} }
// Restore instructions replaced to direct variable pointers // Restore instructions replaced to direct variable pointers
m_localVariables->restoreVariableReferences(&m_instructionSet); m_localVariables->restoreVariableReferences(&m_instructionSet);
m_globalVariables->restoreVariableReferences(&m_instructionSet); m_globalVariables->restoreVariableReferences(&m_instructionSet);
if (m_constants != nullptr) if (m_constants != nullptr)
m_constants->restoreVariableReferences(&m_instructionSet); m_constants->restoreVariableReferences(&m_instructionSet);
if (m_expressionVariables != nullptr)
m_expressionVariables->restoreVariableReferences(&m_instructionSet);
// Restore global variables // Restore global variables
if (globals == nullptr) if (globals == nullptr)
delete m_globalVariables; delete m_globalVariables;
else else
*globals = m_globalVariables; *globals = m_globalVariables;
m_globalVariables = savedGlobals; m_globalVariables = savedGlobals;
// Restore constants // Restore constants
delete m_constants; delete m_constants;
m_constants = savedConstants; m_constants = savedConstants;
// Cleanup // Cleanup
NXSL_Value *v; NXSL_Value *v;
while((v = m_dataStack->pop()) != nullptr) while((v = m_dataStack->pop()) != nullptr)
destroyValue(v); destroyValue(v);
while(m_subLevel > 0) while(m_subLevel > 0)
{ {
m_subLevel--; m_subLevel--;
delete (NXSL_VariableSystem *)m_codeStack->pop();
delete (NXSL_VariableSystem *)m_codeStack->pop(); // Expression variables
auto variableSystem = static_cast<NXSL_VariableSystem*>(m_codeStack->pop()
);
if (variableSystem != nullptr)
{
variableSystem->restoreVariableReferences(&m_instructionSet);
delete variableSystem;
}
// Local variables
variableSystem = static_cast<NXSL_VariableSystem*>(m_codeStack->pop());
if (variableSystem != nullptr)
{
variableSystem->restoreVariableReferences(&m_instructionSet);
delete variableSystem;
}
m_codeStack->pop(); m_codeStack->pop();
} }
NXSL_CatchPoint *p; NXSL_CatchPoint *p;
while((p = (NXSL_CatchPoint *)m_catchStack->pop()) != nullptr) while((p = (NXSL_CatchPoint *)m_catchStack->pop()) != nullptr)
delete p; delete p;
delete_and_null(m_localVariables); delete_and_null(m_localVariables);
delete_and_null(m_expressionVariables); delete_and_null(m_expressionVariables);
delete_and_null(m_dataStack); delete_and_null(m_dataStack);
skipping to change at line 780 skipping to change at line 797
{ {
m_dataStack->push(createValue()); m_dataStack->push(createValue());
} }
} }
else else
{ {
m_dataStack->push(createValue()); m_dataStack->push(createValue());
} }
break; break;
case OPCODE_CLEAR_EXPRVARS: case OPCODE_CLEAR_EXPRVARS:
if (m_expressionVariables != nullptr)
m_expressionVariables->restoreVariableReferences(&m_instructionSet);
if (m_exportedExpressionVariables != nullptr) if (m_exportedExpressionVariables != nullptr)
{ {
delete *m_exportedExpressionVariables; delete *m_exportedExpressionVariables;
*m_exportedExpressionVariables = m_expressionVariables; *m_exportedExpressionVariables = m_expressionVariables;
m_expressionVariables = nullptr; m_expressionVariables = nullptr;
} }
else else
{ {
delete_and_null(m_expressionVariables); delete_and_null(m_expressionVariables);
} }
 End of changes. 3 change blocks. 
2 lines changed or deleted 22 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)