diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/check_stmt.cpp | 2 | ||||
| -rw-r--r-- | src/main.cpp | 2 | ||||
| -rw-r--r-- | src/parser.cpp | 8 |
3 files changed, 6 insertions, 6 deletions
diff --git a/src/check_stmt.cpp b/src/check_stmt.cpp index 74397828d..6c3570cc8 100644 --- a/src/check_stmt.cpp +++ b/src/check_stmt.cpp @@ -1837,7 +1837,7 @@ gb_internal void check_range_stmt(CheckerContext *ctx, Ast *node, u32 mod_flags) if (rs->vals.count == 1) { Type *t = type_deref(operand.type); - if (is_type_map(t) || is_type_bit_set(t)) { + if (t != NULL && (is_type_map(t) || is_type_bit_set(t))) { gbString v = expr_to_string(rs->vals[0]); defer (gb_string_free(v)); error_line("\tSuggestion: place parentheses around the expression\n"); diff --git a/src/main.cpp b/src/main.cpp index 00734c050..41a95338b 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -2172,7 +2172,7 @@ gb_internal void print_show_help(String const arg0, String const &command) { if (LB_USE_NEW_PASS_SYSTEM) { print_usage_line(3, "-o:aggressive"); } - print_usage_line(2, "The default is -o:none."); + print_usage_line(2, "The default is -o:minimal."); print_usage_line(0, ""); } diff --git a/src/parser.cpp b/src/parser.cpp index 5a3fc1634..aba2b8276 100644 --- a/src/parser.cpp +++ b/src/parser.cpp @@ -5609,7 +5609,7 @@ gb_internal AstPackage *try_add_import_path(Parser *p, String path, String const pkg->foreign_files.allocator = permanent_allocator(); // NOTE(bill): Single file initial package - if (kind == Package_Init && string_ends_with(path, FILE_EXT)) { + if (kind == Package_Init && !path_is_directory(path) && string_ends_with(path, FILE_EXT)) { FileInfo fi = {}; fi.name = filename_from_path(path); fi.fullpath = path; @@ -6529,6 +6529,7 @@ gb_internal ParseFileError parse_packages(Parser *p, String init_filename) { GB_ASSERT(init_filename.text[init_filename.len] == 0); String init_fullpath = path_to_full_path(permanent_allocator(), init_filename); + if (!path_is_directory(init_fullpath)) { String const ext = str_lit(".odin"); if (!string_ends_with(init_fullpath, ext)) { @@ -6542,9 +6543,8 @@ gb_internal ParseFileError parse_packages(Parser *p, String init_filename) { } if ((build_context.command_kind & Command__does_build) && build_context.build_mode == BuildMode_Executable) { - String short_path = filename_from_path(path); - char *cpath = alloc_cstring(temporary_allocator(), short_path); - if (gb_file_exists(cpath)) { + String output_path = path_to_string(temporary_allocator(), build_context.build_paths[8]); + if (path_is_directory(output_path)) { error({}, "Please specify the executable name with -out:<string> as a directory exists with the same name in the current working directory"); return ParseFile_DirectoryAlreadyExists; } |