diff --git a/src/Type.cc b/src/Type.cc index d7236e0344..2b9faa8018 100644 --- a/src/Type.cc +++ b/src/Type.cc @@ -1403,8 +1403,8 @@ void CommentedEnumType::AddComment(const string& module_name, const char* name, comments[copy_string(fullname.c_str())] = new_comments; else { - comments[fullname.c_str()]->splice(comments[fullname.c_str()]->end(), - *new_comments); + list* prev_comments = comments[fullname.c_str()]; + prev_comments->splice(prev_comments->end(), *new_comments); delete new_comments; } }