Do not use invalid iterators to fix Windows build.
std::vector::insert invalidates all iterators, so it was not safe to do Script->Opt.Commands.insert(++I, Make(ElfSym::End1)); Script->Opt.Commands.insert(++I, Make(ElfSym::End2)); because after the first line, `I` is no longer valid. This patch rewrites fixes the issue. I belive the new code without higher-order functions is a bit more readable than before. llvm-svn: 312570
Loading
Please register or sign in to comment