Allow comparisons of cstring; Add resize

This commit is contained in:
gingerBill
2018-10-31 10:04:30 +00:00
parent 5aa591d884
commit 6659ceb551
3 changed files with 43 additions and 1 deletions
+5
View File
@@ -3767,6 +3767,11 @@ irValue *ir_emit_comp(irProcedure *proc, TokenKind op_kind, irValue *left, irVal
}
if (is_type_string(a)) {
if (is_type_cstring(a)) {
left = ir_emit_conv(proc, left, t_string);
right = ir_emit_conv(proc, right, t_string);
}
char *runtime_proc = nullptr;
switch (op_kind) {
case Token_CmpEq: runtime_proc = "string_eq"; break;
+3 -1
View File
@@ -1238,8 +1238,10 @@ bool is_type_comparable(Type *t) {
return false;
case Basic_rune:
return true;
case Basic_string:
return true;
case Basic_cstring:
return false;
return true;
case Basic_typeid:
return true;
}