Fix RegisterRestorer not handling potential throws on register assign

This should fix part of #1214
This commit is contained in:
Maxime Coste 2017-02-13 23:31:16 +00:00
parent 55bd3b7949
commit e3a04dfa65

View File

@ -1510,9 +1510,16 @@ public:
~RegisterRestorer()
{
if (m_name != 0)
if (m_name != 0) try
{
RegisterManager::instance()[m_name] = m_save;
}
catch (runtime_error& e)
{
write_to_debug_buffer(format("Could not restore register '{}': {}",
m_name, e.what()));
}
}
private:
Vector<String> m_save;