mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-05 23:28:48 +00:00
Merge pull request #2145 from jaspergeer/fix-scalar-cast-to-non-square-matrix
fix #2130 Assertion failure in compiler on cast of scalar to non-square matrix
This commit is contained in:
+6
-5
@@ -821,11 +821,12 @@ i64 check_distance_between_types(CheckerContext *c, Operand *operand, Type *type
|
|||||||
if (are_types_identical(src, dst)) {
|
if (are_types_identical(src, dst)) {
|
||||||
return 5;
|
return 5;
|
||||||
}
|
}
|
||||||
|
if (dst->Matrix.row_count == dst->Matrix.column_count) {
|
||||||
Type *dst_elem = base_array_type(dst);
|
Type *dst_elem = base_array_type(dst);
|
||||||
i64 distance = check_distance_between_types(c, operand, dst_elem);
|
i64 distance = check_distance_between_types(c, operand, dst_elem);
|
||||||
if (distance >= 0) {
|
if (distance >= 0) {
|
||||||
return distance + 7;
|
return distance + 7;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user