[llvm-dev] When is a store not (memory) safe?

fee via llvm-dev llvm-dev at lists.llvm.org
Sun Oct 2 09:48:14 PDT 2016


Hi all,

I am trying to identify when a write to memory (store) is safe or not (based on LLVM IR).
I refer "safe" to spatial safety (no out of bounds write) and not temporal safety (no double free() etc).

My current approach would be to declare every pointer as unsafe that is computed somewhere by a GEP instruction with non constant indices, as well as constant indices that can be proven to be out of
bounds (but that would be more a thing for the compiler to complain).

Is that approach about right?
Are there other situations where spatial safety might be violated?
Are there already analysis that can determine something like this?

Thanks you.

Regards,

Fredi


More information about the llvm-dev mailing list