mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-04 06:38:47 +00:00
Allow swizzle to take more arguments than the original array length
This commit is contained in:
@@ -2460,7 +2460,7 @@ gb_internal bool check_builtin_procedure(CheckerContext *c, Operand *operand, As
|
|||||||
arg_count++;
|
arg_count++;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (arg_count > max_count) {
|
if (false && 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) {
|
} else if (arg_count < 2) {
|
||||||
|
|||||||
@@ -3814,7 +3814,7 @@ gb_internal lbAddr lb_build_array_swizzle_addr(lbProcedure *p, AstCallExpr *ce,
|
|||||||
Type *type = base_type(lb_addr_type(addr));
|
Type *type = base_type(lb_addr_type(addr));
|
||||||
GB_ASSERT(type->kind == Type_Array);
|
GB_ASSERT(type->kind == Type_Array);
|
||||||
i64 count = type->Array.count;
|
i64 count = type->Array.count;
|
||||||
if (count <= 4) {
|
if (count <= 4 && index_count <= 4) {
|
||||||
u8 indices[4] = {};
|
u8 indices[4] = {};
|
||||||
u8 index_count = 0;
|
u8 index_count = 0;
|
||||||
for (i32 i = 1; i < ce->args.count; i++) {
|
for (i32 i = 1; i < ce->args.count; i++) {
|
||||||
|
|||||||
Reference in New Issue
Block a user