Adding in proper copy_construct into function calls and destruct afterwards. Doesn't correctly destruct return values yet.

This commit is contained in:
Nathan Braswell
2016-05-21 11:20:29 -07:00
parent cf8090f825
commit 828f36daab
5 changed files with 100 additions and 54 deletions

View File

@@ -1139,6 +1139,8 @@ fun get_builtin_function(name: string, param_types: vector<*type>): *ast_node {
if (name == "." || name == "->") {
if (name == "->" && param_types[0]->indirection == 0)
error(string("drereferencing not a pointer: ") + name)
else if (name == "." && param_types[0]->indirection != 0)
error(string("dot operator on a pointer: ") + name)
else
return ast_function_ptr(name, type_ptr(param_types, param_types[1]), vector<*ast_node>(), false)
}