From 6659ceb551c3d1959ab8b8aa3301f66973cf1aa6 Mon Sep 17 00:00:00 2001 From: gingerBill Date: Wed, 31 Oct 2018 10:04:30 +0000 Subject: Allow comparisons of `cstring`; Add `resize` --- src/ir.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/ir.cpp') diff --git a/src/ir.cpp b/src/ir.cpp index 039b89954..7cfd8e113 100644 --- a/src/ir.cpp +++ b/src/ir.cpp @@ -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; -- cgit v1.2.3