Skip to content

Commit 7163605

Browse files
authored
Merge pull request #208 from ChAoSUnItY/chore/global_str
Add FIXME for global string assignment
2 parents e5cc94c + 9624314 commit 7163605

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/parser.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2084,6 +2084,13 @@ bool read_global_assignment(char *token)
20842084
var = find_global_var(token);
20852085
if (var) {
20862086
if (lex_peek(T_string, NULL)) {
2087+
/* FIXME: Current implementation lacks of considerations:
2088+
* 1. string literal should be stored in .rodata section of elf
2089+
* 2. this does not respect the variable type, if var is char *,
2090+
* then simply assign the data address of string literal,
2091+
* otherwise, if var is char[], then copies the string and
2092+
* mutate the size of var here.
2093+
*/
20872094
read_literal_param(parent, bb);
20882095
rs1 = opstack_pop();
20892096
vd = var;

0 commit comments

Comments
 (0)