From 3a3144f3f5c822d8931baf2a94bb75cfe4024a18 Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Sun, 7 May 2017 16:22:29 +0100 Subject: [PATCH] Fix use of invalidated iterator in the command map on exception The command map can get mutated by command execution, so the iterators can get invalidated (now that we use our curstom HashMap implementation, all iterators are potentially invalidated by insert/removal) --- src/command_manager.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/command_manager.cc b/src/command_manager.cc index 48b08c5f..edecb9c4 100644 --- a/src/command_manager.cc +++ b/src/command_manager.cc @@ -456,7 +456,7 @@ void CommandManager::execute_single_command(CommandParameters params, catch (runtime_error& error) { throw runtime_error(format("{}:{}: '{}' {}", pos.line+1, pos.column+1, - command_it->key, error.what())); + params[0], error.what())); } }