Skip to content
Snippets Groups Projects
Commit ec52e19d authored by Nat Goodspeed's avatar Nat Goodspeed
Browse files

DEV-32777, QAR-1619: Disable MSVC Release-build optimization for LLCoros::launchImpl().

This fixes the Release-build crash in lllogin_test.cpp.
parent c3e8c1f7
No related branches found
No related tags found
No related merge requests found
......@@ -54,15 +54,6 @@ bool LLCoros::cleanup(const LLSD&)
return false;
}
std::string LLCoros::launchImpl(const std::string& prefix, coro* newCoro)
{
std::string name(generateDistinctName(prefix));
mCoros.insert(name, newCoro);
/* Run the coroutine until its first wait, then return here */
(*newCoro)(std::nothrow);
return name;
}
std::string LLCoros::generateDistinctName(const std::string& prefix) const
{
// Allowing empty name would make getName()'s not-found return ambiguous.
......@@ -116,3 +107,31 @@ std::string LLCoros::getNameByID(const void* self_id) const
}
return "";
}
/*****************************************************************************
* MUST BE LAST
*****************************************************************************/
// Turn off MSVC optimizations for just LLCoros::launchImpl() -- see
// DEV-32777. But MSVC doesn't support push/pop for optimization flags as it
// does for warning suppression, and we really don't want to force
// optimization ON for other code even in Debug or RelWithDebInfo builds.
#if LL_MSVC
// work around broken optimizations
#pragma warning(disable: 4748)
#pragma optimize("", off)
#endif // LL_MSVC
std::string LLCoros::launchImpl(const std::string& prefix, coro* newCoro)
{
std::string name(generateDistinctName(prefix));
mCoros.insert(name, newCoro);
/* Run the coroutine until its first wait, then return here */
(*newCoro)(std::nothrow);
return name;
}
#if LL_MSVC
// reenable optimizations
#pragma optimize("", on)
#endif // LL_MSVC
......@@ -56,7 +56,7 @@ public:
return pump.listen(mName, boost::bind(&LoginListener::call, this, _1));
}
LLSD lastEvent() { return mLastEvent; }
LLSD lastEvent() const { return mLastEvent; }
friend std::ostream& operator<<(std::ostream& out, const LoginListener& listener)
{
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment