Skip to content

Commit

Permalink
Merge pull request #1625 from jhett12321/dotnet-fix-nested-stack
Browse files Browse the repository at this point in the history
DotNET: Copy & reset s_pushedCount before executing command.
  • Loading branch information
mtijanic authored Apr 13, 2023
2 parents b2e1f41 + dca72ad commit 9b295eb
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions Plugins/DotNET/DotNETExports.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -208,10 +208,13 @@ static void CallBuiltIn(int32_t id)
{
auto vm = Globals::VirtualMachine();
auto cmd = static_cast<CNWVirtualMachineCommands*>(Globals::VirtualMachine()->m_pCmdImplementer);

int pushedCount = s_pushedCount;
s_pushedCount = 0;

LOG_DEBUG("Calling BuiltIn %i.", id);
ASSERT(vm->m_nRecursionLevel >= 0);
cmd->ExecuteCommand(id, s_pushedCount);
s_pushedCount = 0;
cmd->ExecuteCommand(id, pushedCount);
}

static void StackPushInteger(int32_t value)
Expand Down

0 comments on commit 9b295eb

Please sign in to comment.