diff options
author | Nat Goodspeed <nat@lindenlab.com> | 2009-09-25 10:55:25 -0400 |
---|---|---|
committer | Nat Goodspeed <nat@lindenlab.com> | 2009-09-25 10:55:25 -0400 |
commit | ec52e19dd16908acd72b78720880391a74ee8886 (patch) | |
tree | 8237eed7bef9a19c0a09d3079cdcc1cfb2f61d17 | |
parent | c3e8c1f738b14de74b23b3a7276ef4dc083c0887 (diff) |
DEV-32777, QAR-1619: Disable MSVC Release-build optimization for LLCoros::launchImpl().
This fixes the Release-build crash in lllogin_test.cpp.
-rw-r--r-- | indra/llcommon/llcoros.cpp | 37 | ||||
-rw-r--r-- | indra/viewer_components/login/tests/lllogin_test.cpp | 2 |
2 files changed, 29 insertions, 10 deletions
diff --git a/indra/llcommon/llcoros.cpp b/indra/llcommon/llcoros.cpp index 5d23e1d284..377bfaa247 100644 --- a/indra/llcommon/llcoros.cpp +++ b/indra/llcommon/llcoros.cpp @@ -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 diff --git a/indra/viewer_components/login/tests/lllogin_test.cpp b/indra/viewer_components/login/tests/lllogin_test.cpp index e43065d49f..51f00c8344 100644 --- a/indra/viewer_components/login/tests/lllogin_test.cpp +++ b/indra/viewer_components/login/tests/lllogin_test.cpp @@ -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) { |