Fix reference to literal
This commit is contained in:
@@ -3,5 +3,5 @@
|
||||
pushd %~dp0
|
||||
rem cl main.cpp -I.. user32.lib
|
||||
clang core_main.cpp -O0 -Wall -Wno-unused-function -fno-exceptions -fdiagnostics-absolute-paths -g -o main.exe -Wl,user32.lib
|
||||
ubuntu run clang core_main.cpp -O0 -Wall -Wno-unused-function -fno-exceptions -fdiagnostics-absolute-paths -g -o core.out
|
||||
rem ubuntu run clang core_main.cpp -O0 -Wall -Wno-unused-function -fno-exceptions -fdiagnostics-absolute-paths -g -o core.out
|
||||
popd
|
||||
|
||||
@@ -1344,13 +1344,16 @@ resolve_expr(Ast_Expr *ast, Resolve_Flag flags, Ast_Type *compound_and_const_str
|
||||
rewrite_into_const(node, Ast_Array, value.value);
|
||||
}
|
||||
|
||||
|
||||
node->resolved_type = type_pointer(value.type_val);
|
||||
return operand_type(node->resolved_type);
|
||||
}
|
||||
else{ compiler_error(node->pos, "Dereferencing expression %Q that is not a [Pointer] or [Type]", typestring(value.type)); return {}; }
|
||||
}
|
||||
else if(node->op == TK_Dereference){
|
||||
if(!value.is_lvalue){
|
||||
compiler_error(node->pos, "Can't take a pointer of this expression. It's not bound to anything so taking a pointer of it would be pretty silly.");
|
||||
}
|
||||
|
||||
node->resolved_type = type_pointer(value.type);
|
||||
return operand_lvalue_set_flag_on_node(node->resolved_type, node);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user