summaryrefslogtreecommitdiff
path: root/lib/ubsan/ubsan_handlers.cc
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2012-10-10 01:10:59 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2012-10-10 01:10:59 +0000
commitb04caf1385a4279a7b95d41c3ccefc61842c3633 (patch)
treec784b00b058e7ac16887758d4bde5af8c882d4e6 /lib/ubsan/ubsan_handlers.cc
parented81c21984efb8c1f96c82de1dd5dbcea5d7aa65 (diff)
-fcatch-undefined-behavior: handler for VLA bound which evaluates to a non-positive value.
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@165582 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/ubsan/ubsan_handlers.cc')
-rw-r--r--lib/ubsan/ubsan_handlers.cc8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/ubsan/ubsan_handlers.cc b/lib/ubsan/ubsan_handlers.cc
index 8aec335b8..fa3c1e0fc 100644
--- a/lib/ubsan/ubsan_handlers.cc
+++ b/lib/ubsan/ubsan_handlers.cc
@@ -126,3 +126,11 @@ void __ubsan::__ubsan_handle_missing_return(UnreachableData *Data) {
"without returning a value");
Die();
}
+
+void __ubsan::__ubsan_handle_vla_bound_not_positive(VLABoundData *Data,
+ ValueHandle Bound) {
+ Diag(Data->Loc, "variable length array bound evaluates to "
+ "non-positive value %0")
+ << Value(Data->Type, Bound);
+ Die();
+}