[PATCH] D25295: [ubsan] Handle undef values in the integer overflow diagnostic

Vedant Kumar via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 21 14:51:16 PDT 2016


vsk added inline comments.


================
Comment at: lib/ubsan/ubsan_handlers.cc:115
+  default:
+    return 0;
+  }
----------------
vsk wrote:
> filcab wrote:
> > Don't make errors disappear like this. Add an `UNREACHABLE()` to the default case.
> I will try and think of a better way to do this. As it stands, the problem is that the default case isn't unreachable. If e.g the optimizer decides to pass in (0, 0) into the overflow handler instead of (INT_MAX, INT_MAX), we would hit it.
D'oh, what a silly thinko! Sorry, of course this is unreachable.


https://reviews.llvm.org/D25295





More information about the llvm-commits mailing list