Make the string type elements "immutable", akin to char const * in C

Allows for extra security and optimization benefits
This commit is contained in:
gingerBill
2019-12-01 14:10:59 +00:00
parent 7fbe0a6f23
commit 9db81498d8
25 changed files with 255 additions and 176 deletions
+6 -1
View File
@@ -1186,7 +1186,12 @@ bool check_type_specialization_to(CheckerContext *ctx, Type *specialization, Typ
return false;
}
if (t->kind == Type_Struct) {
if (is_type_untyped(t)) {
Operand o = {Addressing_Value};
o.type = default_type(type);
bool can_convert = check_cast_internal(ctx, &o, specialization);
return can_convert;
} else if (t->kind == Type_Struct) {
if (t->Struct.polymorphic_parent == specialization) {
return true;
}