arphaman added a comment.

Ok, so now the null check `return.sloc.load` won't call the checker in 
compiler-rt and so the program won't `abort` and won't hit the `unreachable`. I 
have one question tough:

This patch changes the behavior of this sanitizer for the example that I gave 
above. Previously a runtime diagnostic was emitted, but now there is none. 
While I'm not saying that the previous behaviour was correct, I'm wondering if 
the new behaviour is right.  I think that for C++ it makes sense, but I don't 
know the right answer for C. I'm leaning more towards the new behaviour, since 
technically in C falling off without returning a value is not UB unless that 
return value is used by the caller. But at the same time, since we don't 
diagnose `return` UB for C, maybe it's still worth diagnosing this particular 
issue? The user might not catch it otherwise at all (or they might catch it 
later when they try to access it, but by that point they might not know where 
the pointer came from). WDYT?


https://reviews.llvm.org/D34299



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to