Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions src/parser.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down