From f8d24923fdd701c0a08b8ffb7200cebdc9820b76 Mon Sep 17 00:00:00 2001 From: gingerBill Date: Sat, 2 Aug 2025 13:23:20 +0100 Subject: Fix `cstring != ""` --- src/llvm_backend_expr.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/llvm_backend_expr.cpp b/src/llvm_backend_expr.cpp index f9007d960..5425572c7 100644 --- a/src/llvm_backend_expr.cpp +++ b/src/llvm_backend_expr.cpp @@ -1560,7 +1560,7 @@ gb_internal lbValue lb_build_binary_expr(lbProcedure *p, Ast *expr) { } else if (lb_is_empty_string_constant(be->right) && !is_type_union(be->left->tav.type)) { // `x == ""` or `x != ""` Type *str_type = t_string; - if (is_type_string16(be->left->tav.type)) { + if (is_type_string16(be->left->tav.type) || is_type_cstring16(be->left->tav.type)) { str_type = t_string16; } lbValue s = lb_build_expr(p, be->left); @@ -1572,7 +1572,7 @@ gb_internal lbValue lb_build_binary_expr(lbProcedure *p, Ast *expr) { } else if (lb_is_empty_string_constant(be->left) && !is_type_union(be->right->tav.type)) { // `"" == x` or `"" != x` Type *str_type = t_string; - if (is_type_string16(be->right->tav.type)) { + if (is_type_string16(be->right->tav.type) || is_type_cstring16(be->right->tav.type)) { str_type = t_string16; } lbValue s = lb_build_expr(p, be->right); -- cgit v1.2.3