Fix rules for recursive initialization with procedure entities; Fix executable name if not given

This commit is contained in:
gingerBill
2020-05-30 12:23:41 +01:00
parent 1d7f99cbdf
commit 84fd40de77
4 changed files with 105 additions and 16 deletions
+8
View File
@@ -10645,9 +10645,17 @@ bool lb_init_generator(lbGenerator *gen, Checker *c) {
if (build_context.out_filepath.len == 0) {
gen->output_name = remove_directory_from_path(init_fullpath);
gen->output_name = remove_extension_from_path(gen->output_name);
gen->output_name = string_trim_whitespace(gen->output_name);
if (gen->output_name.len == 0) {
gen->output_name = c->info.init_scope->pkg->name;
}
gen->output_base = gen->output_name;
} else {
gen->output_name = build_context.out_filepath;
gen->output_name = string_trim_whitespace(gen->output_name);
if (gen->output_name.len == 0) {
gen->output_name = c->info.init_scope->pkg->name;
}
isize pos = string_extension_position(gen->output_name);
if (pos < 0) {
gen->output_base = gen->output_name;