[PATCH] D44607: Recompute invalidated iterator in insertTargetAndModeArgs

Hector Martin via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sun Mar 18 08:26:18 PDT 2018

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 (or running under valgrind).

The easiest reproducer I have is `valgrind x86_64-pc-linux-gnu-clang++ $(seq 1 512)` with a debug build, but I'm not sure that that guarantees an abort in every case. 511 arguments is not sufficient to trigger it on my system, but 512 is.

  rC Clang


More information about the cfe-commits mailing list