[PATCH] D46789: [StackProtector] Don't crash when passing post-SP IR back in

Keno Fischer via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue May 22 12:12:01 PDT 2018


loladiro added a comment.

> If my memory recovey is successful and I understand the problem correctly, the best solution to me is to separate the mutation and analysis code in StackProtector. Suppose we split it into two passes "StackProtectorAnalysis" and "InsertStackProtectorPrologue", will it solve the problem? During the re-run, we only run StackProtectorAnalysis, but never again insert prologue. StackProtectorAnalysis should be kept as-is, without more special logic to detect whether the prologue is already generated (as this patch does). What do you think?

I think your description is accurate, with the small addition that if `shouldEmitSDCheck` is wrong (returns true when it shouldn't), the backend crashes because it expects the middle end to have inserted appropriate global declarations which are not there. I think it makes a lot of sense to separate the analysis and the mutation, but I'm not that's entirely sufficient without also giving the analysis the code to detect whether the code was already generated. Also, at the moment the mutation pass is implicitly added to the pass pipeline. Were you proposing that after the split it no longer is? If so, I think that would be quite breaking to users that expect it to be added implicitly. If not, I'm not sure it fixes the issue. Maybe I'm misunderstanding what you are proposing.


Repository:
  rL LLVM

https://reviews.llvm.org/D46789





More information about the llvm-commits mailing list