aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorgingerBill <bill@gingerbill.org>2022-11-08 11:42:42 +0000
committergingerBill <bill@gingerbill.org>2022-11-08 11:42:42 +0000
commitd77269dee2abe3104df0c36bdffe157a079bec7c (patch)
treeaea29b2c262dc27a9d94c6cf976154a692785a1b /src
parentea263b8cc55cdfbec38dcd6bf64e9cc3fee22fb0 (diff)
Disallow zero sized map keys
Diffstat (limited to 'src')
-rw-r--r--src/types.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/types.cpp b/src/types.cpp
index 9b2fd30d4..c92d8a78f 100644
--- a/src/types.cpp
+++ b/src/types.cpp
@@ -1921,7 +1921,7 @@ bool is_type_valid_for_keys(Type *t) {
if (is_type_untyped(t)) {
return false;
}
- return is_type_comparable(t);
+ return type_size_of(t) > 0 && is_type_comparable(t);
}
bool is_type_valid_bit_set_elem(Type *t) {