summaryrefslogtreecommitdiff
path: root/src/codegen/codegen_utils.c
diff options
context:
space:
mode:
authorZuhaitz Méndez Fernández de Aránguiz <zuhaitz@debian>2026-01-27 23:18:56 +0000
committerZuhaitz Méndez Fernández de Aránguiz <zuhaitz@debian>2026-01-27 23:18:56 +0000
commit7f7be8a8202b9ccea19ae379665e3a34a81b6797 (patch)
treecca7fdae365a7240a883cc9ebf0e5090c4311320 /src/codegen/codegen_utils.c
parent70144b6829c3ca8ff8b46e40b358cc711db85efb (diff)
Improved examples in 'examples/'
Diffstat (limited to 'src/codegen/codegen_utils.c')
-rw-r--r--src/codegen/codegen_utils.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/codegen/codegen_utils.c b/src/codegen/codegen_utils.c
index 8de3cf6..391ebd3 100644
--- a/src/codegen/codegen_utils.c
+++ b/src/codegen/codegen_utils.c
@@ -411,6 +411,10 @@ char *infer_type(ParserContext *ctx, ASTNode *node)
char *inner = infer_type(ctx, node->unary.operand);
if (inner)
{
+ if (strcmp(inner, "string") == 0)
+ {
+ return xstrdup("char");
+ }
char *ptr = strchr(inner, '*');
if (ptr)
{