aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2025-12-11 21:02:31 +0900
committernsfisis <nsfisis@gmail.com>2025-12-11 21:08:39 +0900
commit000f1d7f7412440619112b09f64ff653d960ed25 (patch)
tree020c60c6a2464db430ecf5abb39594ecec78761c /src
parent47d43f5a583dc2d474e553afe0cb682d878231b1 (diff)
downloadducc-000f1d7f7412440619112b09f64ff653d960ed25.tar.gz
ducc-000f1d7f7412440619112b09f64ff653d960ed25.tar.zst
ducc-000f1d7f7412440619112b09f64ff653d960ed25.zip
fix: static function returning pointer type being marked as global
Diffstat (limited to 'src')
-rw-r--r--src/parse.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/parse.c b/src/parse.c
index 39bd8f2..819c418 100644
--- a/src/parse.c
+++ b/src/parse.c
@@ -1433,8 +1433,12 @@ static AstNode* parse_func_def(Parser* p, AstNode* decls) {
}
Type* ty = decls->node_items[0].ty;
- ty->storage_class = ty->result->storage_class;
- ty->result->storage_class = StorageClass_unspecified;
+ Type* base_ty = ty->result;
+ while (base_ty->base) {
+ base_ty = base_ty->base;
+ }
+ ty->storage_class = base_ty->storage_class;
+ base_ty->storage_class = StorageClass_unspecified;
const char* name = decls->node_items[0].name;
AstNode* params = ty->params;