diff --git a/src/build_settings.cpp b/src/build_settings.cpp index 7d7634806..5948bd0f4 100644 --- a/src/build_settings.cpp +++ b/src/build_settings.cpp @@ -263,7 +263,7 @@ String path_to_fullpath(gbAllocator a, String s) { gb_mutex_lock(&string_buffer_mutex); p = realpath(cast(char *)s.text, 0); gb_mutex_unlock(&string_buffer_mutex); - if(p == nullptr) return make_string_c(""); + if(p == nullptr) return String{}; return make_string_c(p); } #else diff --git a/src/check_expr.cpp b/src/check_expr.cpp index 9981a4543..6ac837529 100644 --- a/src/check_expr.cpp +++ b/src/check_expr.cpp @@ -3884,7 +3884,7 @@ break; isize add_dependencies_from_unpacking(Checker *c, Entity **lhs, isize lhs_count, isize tuple_index, isize tuple_count) { if (lhs != nullptr) { - for (isize j = 0; tuple_index < lhs_count && j < tuple_count; j++) { + for (isize j = 0; (tuple_index + j) < lhs_count && j < tuple_count; j++) { Entity *e = lhs[tuple_index + j]; DeclInfo *decl = decl_info_of_entity(&c->info, e); if (decl != nullptr) { @@ -5421,14 +5421,13 @@ ExprKind check_expr_base_internal(Checker *c, Operand *o, AstNode *node, Type *t i64 max = 0; isize index = 0; - isize elem_count = cl->elems.count; Type *bet = base_type(elem_type); if (!elem_type_can_be_constant(bet)) { is_constant = false; } - for (; index < elem_count; index++) { + for (; index < cl->elems.count; index++) { AstNode *e = cl->elems[index]; if (e == nullptr) { error(node, "Invalid literal element");