From 9624314d80d94139a27371250319ccc89aef2d48 Mon Sep 17 00:00:00 2001 From: Kyle Lin Date: Thu, 22 May 2025 03:16:48 +0800 Subject: [PATCH] Add FIXME for global string assignment --- src/parser.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/parser.c b/src/parser.c index 3401ca5a..3991a255 100644 --- a/src/parser.c +++ b/src/parser.c @@ -2084,6 +2084,13 @@ bool read_global_assignment(char *token) var = find_global_var(token); if (var) { if (lex_peek(T_string, NULL)) { + /* FIXME: Current implementation lacks of considerations: + * 1. string literal should be stored in .rodata section of elf + * 2. this does not respect the variable type, if var is char *, + * then simply assign the data address of string literal, + * otherwise, if var is char[], then copies the string and + * mutate the size of var here. + */ read_literal_param(parent, bb); rs1 = opstack_pop(); vd = var;