Fixing bugs with strings
This commit is contained in:
@@ -302,9 +302,8 @@ gen_expr(Ast_Expr *ast, Ast_Type *type_of_var){
|
||||
CASE(INDEX, Index){
|
||||
gen("(");
|
||||
gen_expr(node->expr);
|
||||
if(is_string(node->resolved_type)){
|
||||
if(!(type_of_var && type_of_var == type_pointer_to_char))
|
||||
gen(".str");
|
||||
if(node->index_original_type == type_string){
|
||||
gen(".str");
|
||||
}
|
||||
else if(is_slice(node->index_original_type)){
|
||||
gen(".data");
|
||||
|
||||
Reference in New Issue
Block a user