commit f2601e7e636350aef580acba054935488ae7ae70
parent cf08f8e4ed3806e263089f3efe8e986365241c0e
Author: Brian Swetland <swetland@frotz.net>
Date: Thu, 12 Oct 2023 14:50:01 -0700
compiler0: fix up array types to include length
Diffstat:
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/compiler0.c b/compiler0.c
@@ -1098,7 +1098,7 @@ Type *parse_array_type(void) {
}
// TODO: slices
char tmp[256];
- sprintf(tmp, "%s_a", type->of->name->text);
+ sprintf(tmp, "%s_a%u", type->of->name->text, nelem);
type->name = string_make(tmp, strlen(tmp));
emit_type("typedef %s_t %s_t[%u];\n", type->of->name->text, type->name->text, nelem);
return type;