From 94299d16d1443cd8b731e2eba9b4d1e3fb8048bd Mon Sep 17 00:00:00 2001 From: Timon Kruiper Date: Wed, 20 Nov 2019 19:34:20 +0100 Subject: Stage1: Add compile error for an empty switch on a integer --- src/range_set.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/range_set.cpp') 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; -- cgit v1.2.3