Browse Source

Fix 64bit related

Greg 10 years ago
parent
commit
9ad8751dde

+ 3 - 0
gmsrc/doc/ChangeLog.txt

@@ -413,3 +413,6 @@ o Reordered GC descruction sequence to avoid Write Barrier mis-fire.
 
 19/05/14
 o Fix EndOn bug reported by Korrion
+
+13/07/15
+o Fix 64bit related. Thanks palota.

+ 2 - 2
gmsrc/src/gm/gmFunctionObject.cpp

@@ -145,12 +145,12 @@ bool gmFunctionObject::Init(gmMachine * a_machine, bool a_debug, gmFunctionInfo
         case BC_BRNZ :
         case BC_BRZK :
         case BC_BRNZK :
-        case BC_FOREACH :
         case BC_GETGLOBAL :
         case BC_SETGLOBAL :
         case BC_GETTHIS :
         case BC_SETTHIS : instruction += sizeof(gmptr); break;
-        case BC_PUSHINT : instruction += sizeof(gmint); break;
+        case BC_FOREACH :
+		case BC_PUSHINT : instruction += sizeof(gmint); break;
         case BC_PUSHFP : instruction += sizeof(gmfloat); break;
       
         case BC_CALL :

+ 1 - 1
gmsrc/src/gm/gmThread.cpp

@@ -26,7 +26,7 @@
 #define OPERATOR(TYPE, OPERATOR) (m_machine->GetTypeNativeOperator((TYPE), (OPERATOR)))
 #define CALLOPERATOR(TYPE, OPERATOR) (m_machine->GetTypeOperator((TYPE), (OPERATOR)))
 #define GMTHREAD_LOG m_machine->GetLog().LogEntry
-#define PUSHNULL top->m_type = GM_NULL; top->m_value.m_int = 0; ++top;
+#define PUSHNULL top->m_type = GM_NULL; top->m_value.m_ref = 0; ++top;
 
 // helper functions
 void gmGetLineFromString(const char * a_string, int a_line, char * a_buffer, int a_len)

+ 1 - 1
gmsrc/src/gm/gmThread.h

@@ -272,7 +272,7 @@ inline const gmFunctionObject * gmThread::GetFunctionObject() const
 inline void gmThread::PushNull()
 {
   m_stack[m_top].m_type = GM_NULL;
-  m_stack[m_top++].m_value.m_int = 0;
+  m_stack[m_top++].m_value.m_ref = 0; // equality operator compares references
 }
 
 

+ 2 - 2
gmsrc/src/gm/gmVariable.h

@@ -90,10 +90,10 @@ struct gmVariable
   void SetUser(gmMachine * a_machine, void * a_userPtr, int a_userType);
   
 
-  inline void Nullify() { m_type = GM_NULL; m_value.m_int = 0; }
+  inline void Nullify() { m_type = GM_NULL; m_value.m_ref = 0; }
   inline bool IsNull() const { return m_type == GM_NULL; }
   inline bool IsReference() const { return m_type > GM_FLOAT; }
-	inline bool IsInt() const { return m_type == GM_INT; }
+  inline bool IsInt() const { return m_type == GM_INT; }
   inline bool IsFloat() const { return m_type == GM_FLOAT; }
   inline bool IsNumber() const { return IsInt() || IsFloat(); }