shithub: mc

Download patch

ref: e25072ea2bea6bc603143ddb0cc110982e90161b
parent: 763b93301675ced644ce16f645102c2bc0357ea3
author: Ori Bernstein <ori@eigenstate.org>
date: Sat Jan 9 16:47:19 EST 2016

Use mangled names for type info symbols.

--- a/6/gen.c
+++ b/6/gen.c
@@ -137,9 +137,13 @@
 char *tydescid(char *buf, size_t bufsz, Type *ty)
 {
 	char *sep, *ns;
+	char *p, *end;
+	size_t i;
 
 	sep = "";
 	ns = "";
+	p = buf;
+	end = buf + bufsz;
 	if (ty->type == Tyname) {
 		if (ty->name->name.ns) {
 			ns = ty->name->name.ns;
@@ -146,9 +150,11 @@
 			sep = "$";
 		}
 		if (ty->vis == Visexport || ty->isimport)
-			bprintf(buf, bufsz, "_tydesc$%s%s%s", ns, sep, ty->name->name.name);
+			p += bprintf(p, end - p, "_tydesc$%s%s%s", ns, sep, ty->name->name.name);
 		else
-			bprintf(buf, bufsz, "_tydesc$%s%s%s$%d", ns, sep, ty->name->name.name, ty->tid);
+			p += bprintf(p, end - p, "_tydesc$%s%s%s$%d", ns, sep, ty->name->name.name, ty->tid);
+		for (i = 0; i < ty->narg; i++)
+			p += tyidfmt(p, end - p, ty->arg[i]);
 	} else {
 		if (file->file.globls->name) {
 			ns = file->file.globls->name;