aboutsummaryrefslogtreecommitdiff
path: root/src/range_set.cpp
diff options
context:
space:
mode:
authorTimon Kruiper <timonkruiper@gmail.com>2019-11-20 19:34:20 +0100
committerAndrew Kelley <andrew@ziglang.org>2019-11-22 04:00:47 +0000
commit94299d16d1443cd8b731e2eba9b4d1e3fb8048bd (patch)
tree72e9c47ff8bf53a7abdbe239f41616b880ccc153 /src/range_set.cpp
parente3404e3c78307092e849dc0609f77932b263e3fc (diff)
downloadzig-94299d16d1443cd8b731e2eba9b4d1e3fb8048bd.tar.gz
zig-94299d16d1443cd8b731e2eba9b4d1e3fb8048bd.zip
Stage1: Add compile error for an empty switch on a integer
Diffstat (limited to 'src/range_set.cpp')
-rw-r--r--src/range_set.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/range_set.cpp b/src/range_set.cpp
index fd0076191b..9e621d2f13 100644
--- a/src/range_set.cpp
+++ b/src/range_set.cpp
@@ -40,6 +40,9 @@ void rangeset_sort(RangeSet *rs) {
}
bool rangeset_spans(RangeSet *rs, BigInt *first, BigInt *last) {
+ if (rs->src_range_list.length == 0)
+ return false;
+
rangeset_sort(rs);
const Range *first_range = &rs->src_range_list.at(0).range;