Add the fun_ prefix to functions to avoid name collisions in some cases (like with sizeof) and test_memTest passes as well. 43

This commit is contained in:
Nathan Braswell
2016-02-29 05:08:49 -05:00
parent d6bb0cf45b
commit 10e21883c8

View File

@@ -686,7 +686,9 @@ obj c_generator (Object) {
// be careful, operators like . come through this
if (!backing.body_statement)
return backing.name
result = ""
if (backing.name == "main")
return backing.name
result = "fun_"
var upper = backing.scope.get_with_default(string("~enclosing_scope"), vector(null<ast_node>()))[0]
if (upper && is_type_def(upper))
result += get_name(upper) + "_"