mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-03 22:28:46 +00:00
Fix comparison bug of enumerated arrays
This commit is contained in:
@@ -10918,7 +10918,7 @@ lbValue lb_emit_comp(lbProcedure *p, TokenKind op_kind, lbValue left, lbValue ri
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (is_type_array(a)) {
|
if (is_type_array(a) || is_type_enumerated_array(a)) {
|
||||||
Type *tl = base_type(a);
|
Type *tl = base_type(a);
|
||||||
lbValue lhs = lb_address_from_load_or_generate_local(p, left);
|
lbValue lhs = lb_address_from_load_or_generate_local(p, left);
|
||||||
lbValue rhs = lb_address_from_load_or_generate_local(p, right);
|
lbValue rhs = lb_address_from_load_or_generate_local(p, right);
|
||||||
@@ -10935,7 +10935,11 @@ lbValue lb_emit_comp(lbProcedure *p, TokenKind op_kind, lbValue left, lbValue ri
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool inline_array_arith = type_size_of(tl) <= build_context.max_align;
|
bool inline_array_arith = type_size_of(tl) <= build_context.max_align;
|
||||||
i32 count = cast(i32)tl->Array.count;
|
i32 count = 0;
|
||||||
|
switch (tl->kind) {
|
||||||
|
case Type_Array: count = cast(i32)tl->Array.count; break;
|
||||||
|
case Type_EnumeratedArray: count = cast(i32)tl->EnumeratedArray.count; break;
|
||||||
|
}
|
||||||
|
|
||||||
if (inline_array_arith) {
|
if (inline_array_arith) {
|
||||||
// inline
|
// inline
|
||||||
|
|||||||
Reference in New Issue
Block a user