cgen: fix thread wrapper

pull/4666/head
Alexander Medvednikov 2020-05-01 12:32:10 +02:00
parent 0b8a0d1640
commit 0106eb1cf6
1 changed files with 2 additions and 1 deletions

View File

@ -2956,8 +2956,9 @@ fn (mut g Gen) go_stmt(node ast.GoStmt) {
receiver_sym := g.table.get_type_symbol(it.receiver_type)
name = receiver_sym.name + '_' + name
}
name = name.replace('.', '__')
g.writeln('// go')
wrapper_struct_name := 'thread_arg_' + name.replace('.', '__')
wrapper_struct_name := 'thread_arg_' + name
wrapper_fn_name := name + '_thread_wrapper'
arg_tmp_var := 'arg_' + tmp
g.writeln('$wrapper_struct_name *$arg_tmp_var = malloc(sizeof(thread_arg_$name));')