Skip to content

Patch v0.12.2 - #3177

Merged
SchoolyB merged 30 commits into
mainfrom
patch-v0.12.2
Oct 19, 2026
Merged

SchoolyB merged 30 commits into
mainfrom
patch-v0.12.2

Conversation

@SchoolyB

Copy link
Copy Markdown
Member

This PR mostly covers much needed security improvements along with some bug fixes and a couple performance improvements. Also fixes a bug in CI that wasnt building the Grayscale binary on macOS intel chips

@github-actions github-actions Bot added documentation Improvements or additions to documentation typechecker Related to type checking and validation module-system Related to imports, exports, and module loading stdlib General standard library issues tests Related to unit tests or test infrastructure error-messages Related to improving error messages CI/CD Continuous Integration/Continuous Deployment cli Command-line interface related grayc Related to the grayscale compiler core or its internal tooling labels Oct 18, 2026
for (int i = 0; i < reference_function_signature->parameter_count; i++) {
if (i > 0) position += snprintf(signature_text + position, sizeof(signature_text) - position, ",");
position += snprintf(signature_text + position, sizeof(signature_text) - position, "%s", type_name(reference_function_signature->parameter_types[i]));
if (i > 0) position += (size_t)snprintf(signature_text + position, signature_length - position, ",");
if (i > 0) position += snprintf(signature_text + position, sizeof(signature_text) - position, ",");
position += snprintf(signature_text + position, sizeof(signature_text) - position, "%s", type_name(reference_function_signature->parameter_types[i]));
if (i > 0) position += (size_t)snprintf(signature_text + position, signature_length - position, ",");
position += (size_t)snprintf(signature_text + position, signature_length - position, "%s", type_name(reference_function_signature->parameter_types[i]));
for (int j = 0; j < type_name_deep_copy_depth; j++) {
if (strcmp(type_name_deep_copy_visiting[j], gray_type_name) == 0) return false;
}
if (type_name_deep_copy_depth < CYCLE_GUARD_DEPTH) type_name_deep_copy_visiting[type_name_deep_copy_depth++] = gray_type_name;
Comment on lines +10741 to +10747
return left->kind != TYPE_KIND_UNKNOWN && right->kind != TYPE_KIND_UNKNOWN &&
left->kind != right->kind && left->kind != TYPE_KIND_NIL && right->kind != TYPE_KIND_NIL &&
!(is_integer_kind(left->kind) && is_integer_kind(right->kind)) &&
!(left->kind == TYPE_KIND_STRUCT && is_integer_kind(right->kind)) &&
!(is_integer_kind(left->kind) && right->kind == TYPE_KIND_STRUCT) &&
!(left->kind == TYPE_KIND_ENUM && is_integer_kind(right->kind)) &&
!(is_integer_kind(left->kind) && right->kind == TYPE_KIND_ENUM);
Comment on lines +11603 to +11618
return value_type->kind != TYPE_KIND_UNKNOWN &&
expected_type->kind != TYPE_KIND_UNKNOWN &&
(!types_assignable(checker, expected_type, value_type) ||
(expected_type->kind == TYPE_KIND_POINTER &&
expected_type->name && value_type->name &&
strcmp(expected_type->name, value_type->name) != 0) ||
(expected_type->kind == TYPE_KIND_STRUCT && value_type->kind == TYPE_KIND_STRUCT &&
expected_type->name && value_type->name &&
!typechecker_same_struct_type(checker, expected_type->name, value_type->name)) ||
(expected_type->kind == TYPE_KIND_ENUM && value_type->kind == TYPE_KIND_ENUM &&
expected_type->name && value_type->name &&
!typechecker_same_enum_type(checker, expected_type->name, value_type->name))) &&
!(expected_type->kind == TYPE_KIND_ENUM && is_integer_kind(value_type->kind)) &&
!(is_integer_kind(expected_type->kind) && value_type->kind == TYPE_KIND_STRUCT) &&
!(value_type->kind == TYPE_KIND_NIL &&
(expected_type->kind == TYPE_KIND_POINTER || expected_type->kind == TYPE_KIND_ERROR));
Comment on lines +14927 to +14936
return field_type->kind != TYPE_KIND_UNKNOWN && assigned_value_type->kind != TYPE_KIND_UNKNOWN &&
(!types_assignable(checker, field_type, assigned_value_type) ||
(field_type->kind == TYPE_KIND_POINTER &&
field_type->name && assigned_value_type->name &&
strcmp(field_type->name, assigned_value_type->name) != 0) ||
(field_type->kind == TYPE_KIND_STRUCT && assigned_value_type->kind == TYPE_KIND_STRUCT &&
field_type->name && assigned_value_type->name &&
strcmp(field_type->name, assigned_value_type->name) != 0)) &&
!(assigned_value_type->kind == TYPE_KIND_NIL &&
(field_type->kind == TYPE_KIND_POINTER || field_type->kind == TYPE_KIND_ERROR));
@SchoolyB
SchoolyB merged commit 9a49ceb into main Oct 19, 2026
7 of 9 checks passed
@SchoolyB
SchoolyB deleted the patch-v0.12.2 branch October 19, 2026 00:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CI/CD Continuous Integration/Continuous Deployment cli Command-line interface related documentation Improvements or additions to documentation error-messages Related to improving error messages grayc Related to the grayscale compiler core or its internal tooling module-system Related to imports, exports, and module loading stdlib General standard library issues tests Related to unit tests or test infrastructure typechecker Related to type checking and validation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants