[PATCH] D44607: Recompute invalidated iterator in insertTargetAndModeArgs

2018-03-19 Thread Hector Martin via Phabricator via cfe-commits
marcan added a comment. Note that I don't have commit access, so someone else will have to commit it for me :) Repository: rC Clang https://reviews.llvm.org/D44607 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi

[PATCH] D44607: Recompute invalidated iterator in insertTargetAndModeArgs

2018-03-19 Thread Hector Martin via Phabricator via cfe-commits
marcan updated this revision to Diff 13. Repository: rC Clang https://reviews.llvm.org/D44607 Files: tools/driver/driver.cpp Index: tools/driver/driver.cpp === --- tools/driver/driver.cpp +++ tools/driver/driver.cpp @@ -21

[PATCH] D44607: Recompute invalidated iterator in insertTargetAndModeArgs

2018-03-18 Thread Hector Martin via Phabricator via cfe-commits
marcan added a comment. I'm not sure how to test this. Getting the bug to manifest involves all of having a lot of command line arguments, getting unlucky with the way SmallVectorImpl decides to allocate, and getting unlucky with the glibc allocator deciding to move the data block on realloc (o

[PATCH] D44607: Recompute invalidated iterator in insertTargetAndModeArgs

2018-03-18 Thread Hector Martin via Phabricator via cfe-commits
marcan created this revision. marcan added reviewers: sepavloff, echristo. Herald added a subscriber: cfe-commits. Doing an `.insert()` can potentially invalidate iterators by reallocating the vector's storage. When all the stars align just right, this causes segfaults or glibc aborts. Fix this