mstorsjo accepted this revision. mstorsjo added a comment. Sounds sensible to me; I've tested the patch in the setup that showed the issue this original patch tried to fix, and it seems to work fine there. https://reviews.llvm.org/D38680