mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-06 15:48:51 +00:00
Merge pull request #3709 from Feoramund/stop-low-swizzle
Prevent panic when `swizzle` called with < 2 indices
This commit is contained in:
@@ -2419,6 +2419,9 @@ gb_internal bool check_builtin_procedure(CheckerContext *c, Operand *operand, As
|
|||||||
if (arg_count > max_count) {
|
if (arg_count > max_count) {
|
||||||
error(call, "Too many 'swizzle' indices, %td > %td", arg_count, max_count);
|
error(call, "Too many 'swizzle' indices, %td > %td", arg_count, max_count);
|
||||||
return false;
|
return false;
|
||||||
|
} else if (arg_count < 2) {
|
||||||
|
error(call, "Not enough 'swizzle' indices, %td < 2", arg_count);
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (type->kind == Type_Array) {
|
if (type->kind == Type_Array) {
|
||||||
|
|||||||
Reference in New Issue
Block a user