John Regehr
2011-Apr-08 15:27 UTC
[LLVMdev] finding integer undefined behaviors using clang
Patch and documentation can be found here: http://embed.cs.utah.edu/ubc/ John
Cameron Zwarich
2011-Apr-08 23:07 UTC
[LLVMdev] finding integer undefined behaviors using clang
On Apr 8, 2011, at 8:27 AM, John Regehr wrote:> Patch and documentation can be found here: > > http://embed.cs.utah.edu/ubc/It seems that this could be merged into -fcatch-undefined-behavior while separating mechanism from policy: 1) Adding checks for more undefined behavior. 2) Allowing different choices of trap mechanism when undefined behavior is encountered. Cameron
Cameron Zwarich
2011-Apr-08 23:11 UTC
[LLVMdev] finding integer undefined behaviors using clang
On Apr 8, 2011, at 4:07 PM, Cameron Zwarich wrote:> On Apr 8, 2011, at 8:27 AM, John Regehr wrote: > >> Patch and documentation can be found here: >> >> http://embed.cs.utah.edu/ubc/ > > It seems that this could be merged into -fcatch-undefined-behavior while separating mechanism from policy: > > 1) Adding checks for more undefined behavior. > > 2) Allowing different choices of trap mechanism when undefined behavior is encountered.I forgot to say that this is nice work. A lot of people don't even know about undefined behavior like this, and it is hard to catch it while you are programming even if you do know about it. Cameron
John Regehr
2011-Apr-09 04:10 UTC
[LLVMdev] finding integer undefined behaviors using clang
Hi Cameron, I agree, it would be nice to integrate this. My quick analysis of the situation, however, was that there's probably some difference of opinion about how heavyweight the trap handler should be. Ours is very heavy, in order to produce informative messages. People using traps in production code -- for example to simulate infinitely-ranged integers -- aren't going to like this. It's probably possible to engineer a solution that makes everyone happy, but it may be quite a bit of work. In the meantime I wanted to get our code out there so people can use it. My hope is that if it turns out to be valuable, someone more conversant with LLVM will figure out how it fits into the bigger picture. John
Seemingly Similar Threads
- [LLVMdev] finding integer undefined behaviors using clang
- [LLVMdev] finding integer undefined behaviors using clang
- [LLVMdev] [cfe-dev] [RFC] Extending and improving Clang's undefined behavior checking
- [LLVMdev] finding integer undefined behaviors using clang
- [LLVMdev] proposal for exploiting undefined behavior much more aggressively