aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/parse.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/parse.c')
-rw-r--r--src/parse.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/parse.c b/src/parse.c
index b6fa043..b65a6b3 100644
--- a/src/parse.c
+++ b/src/parse.c
@@ -577,8 +577,7 @@ static AstNode* parse_cast_expr(Parser* p) {
// TODO: check whether the original type can be casted to the result type.
AstNode* e = parse_cast_expr(p);
- e->ty = ty;
- return e;
+ return ast_new_cast_expr(e, ty);
}
return parse_prefix_expr(p);
}