aboutsummaryrefslogtreecommitdiff
path: root/src/check_type.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/check_type.cpp')
-rw-r--r--src/check_type.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/check_type.cpp b/src/check_type.cpp
index 51f472961..193c42cde 100644
--- a/src/check_type.cpp
+++ b/src/check_type.cpp
@@ -2802,6 +2802,11 @@ bool check_type_internal(CheckerContext *ctx, Ast *e, Type **type, Type *named_t
*type = alloc_type_array(elem, count, generic_type);
goto array_end;
}
+ if (count < 1 || !is_power_of_two(count)) {
+ error(at->elem, "Invalid length for 'intrinsics.simd_vector', expected a power of two length, got '%lld'", cast(long long)count);
+ *type = alloc_type_array(elem, count, generic_type);
+ goto array_end;
+ }
*type = alloc_type_simd_vector(count, elem);
} else {