From dfacd2c86c19e608f2158ad49097eaae55e1461c Mon Sep 17 00:00:00 2001 From: Sandu Liviu Catalin Date: Sat, 2 Apr 2016 12:32:39 +0300 Subject: [PATCH] Reverse the order of the VM and stack top in stack guard. --- source/Base/Shared.hpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/source/Base/Shared.hpp b/source/Base/Shared.hpp index d5198760..151467a7 100644 --- a/source/Base/Shared.hpp +++ b/source/Base/Shared.hpp @@ -34,7 +34,7 @@ struct StackGuard * Default constructor. */ StackGuard() - : m_Top(sq_gettop(DefaultVM::Get())), m_VM(DefaultVM::Get()) + : m_VM(DefaultVM::Get()), m_Top(sq_gettop(m_VM)) { /* ... */ } @@ -43,7 +43,7 @@ struct StackGuard * Base constructor. */ StackGuard(HSQUIRRELVM vm) - : m_Top(sq_gettop(vm)), m_VM(vm) + : m_VM(vm), m_Top(sq_gettop(vm)) { /* ... */ } @@ -79,8 +79,8 @@ struct StackGuard private: // -------------------------------------------------------------------------------------------- - Int32 m_Top; /* The top of the stack when this instance was created. */ - HSQUIRRELVM m_VM; /* The VM where the stack should be restored. */ + HSQUIRRELVM m_VM; // The VM where the stack should be restored. + Int32 m_Top; // The top of the stack when this instance was created. }; /* ------------------------------------------------------------------------------------------------