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
@@ -11485,9 +11485,17 @@ bool ir_gen_init(irGen *s, Checker *c) {
if (build_context.out_filepath.len == 0) {
s->output_name = remove_directory_from_path(init_fullpath);
s->output_name = remove_extension_from_path(s->output_name);
s->output_name = string_trim_whitespace(s->output_name);
if (s->output_name.len == 0) {
s->output_name = c->info.init_scope->pkg->name;
}
s->output_base = s->output_name;
} else {
s->output_name = build_context.out_filepath;
s->output_name = string_trim_whitespace(s->output_name);
if (s->output_name.len == 0) {
s->output_name = c->info.init_scope->pkg->name;
}
isize pos = string_extension_position(s->output_name);
if (pos < 0) {
s->output_base = s->output_name;