Commit c3ea334f authored by aleajactaest's avatar aleajactaest

correct issue #38 crash ais sur debian stretch

parent e6c10449
diff --git a/code/nel/include/nel/misc/smart_ptr.h b/code/nel/include/nel/misc/smart_ptr.h
index 2273cebeb..df80c7b77 100644
--- a/code/nel/include/nel/misc/smart_ptr.h
+++ b/code/nel/include/nel/misc/smart_ptr.h
@@ -495,6 +495,7 @@ public:
: _DbgCRefs(0)
, _DbgCCstRefs(0)
, _MaxRef(maxRef)
+ , _CheckOn(true)
, _FirstReference(NULL)
, _FirstCstReference(NULL)
{
diff --git a/code/ryzom/server/src/ai_service/script_vm.h b/code/ryzom/server/src/ai_service/script_vm.h
index bc6e56c15..0b931c63d 100644
--- a/code/ryzom/server/src/ai_service/script_vm.h
+++ b/code/ryzom/server/src/ai_service/script_vm.h
@@ -141,6 +141,8 @@ public:
union
{
int _vali;
+ float _valf;
+ std::string * _valsp;
uintptr_t _valp;
};
@@ -351,7 +353,7 @@ inline
CScriptStack::CStackEntry& CScriptStack::CStackEntry::operator=(float const& f)
{
clean();
- _vali = *((int*)&f);
+ _valf = f;
_type = EFloat;
return *this;
}
@@ -368,7 +370,7 @@ CScriptStack::CStackEntry& CScriptStack::CStackEntry::operator=(std::string cons
{
clean();
std::string* const strPt = new std::string(str);
- _valp = *((int*)&strPt);
+ _valsp = strPt;
_type = EString;
return *this;
}
@@ -376,7 +378,7 @@ inline
CScriptStack::CStackEntry& CScriptStack::CStackEntry::operator=(IScriptContext* sc)
{
clean();
- _valp = *((int*)&sc);
+ _valp = (uintptr_t) sc;
_type = EContext;
return *this;
}
@@ -484,13 +486,13 @@ inline
std::string& CScriptStack::CStackEntry::getString()
{
nlassert(_type==EString);
- return *(*((std::string**)&_valp));
+ return *( (std::string*) _valp);
}
inline
std::string const& CScriptStack::CStackEntry::getString() const
{
nlassert(_type==EString);
- return *(*((std::string**)&_valp));
+ return *_valsp;
}
inline
IScriptContext* CScriptStack::CStackEntry::getIScriptContext()
@@ -514,13 +516,13 @@ inline
float& CScriptStack::CStackEntry::getFloat()
{
nlassert(_type==EFloat);
- return *((float*)&_vali);
+ return _valf;
}
inline
float const& CScriptStack::CStackEntry::getFloat() const
{
nlassert(_type==EFloat);
- return *((float const*)&_vali);
+ return _valf;
}
inline
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment