Skip to content

Commit 1612f74

Browse files
committed
Do not modify object_files list while processing it
Its contents is useful elsewhere and should not be unnecessarily destroyed.
1 parent 60487f7 commit 1612f74

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

src/goto-cc/compile.cpp

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -346,11 +346,8 @@ bool compilet::link()
346346
convert_symbols(compiled_functions);
347347

348348
// parse object files
349-
while(!object_files.empty())
349+
for(const auto &file_name : object_files)
350350
{
351-
std::string file_name=object_files.front();
352-
object_files.pop_front();
353-
354351
if(read_object_and_link(file_name, symbol_table,
355352
compiled_functions, get_message_handler()))
356353
return true;

0 commit comments

Comments
 (0)