summaryrefslogtreecommitdiff
path: root/src/codegen
diff options
context:
space:
mode:
Diffstat (limited to 'src/codegen')
-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)
{