Restrict #no_capture to pointer-like types only

This commit is contained in:
gingerBill
2024-07-14 12:44:13 +01:00
parent 5ce6676914
commit 3533094cc2
2 changed files with 4 additions and 6 deletions
+3 -1
View File
@@ -254,7 +254,9 @@ gb_internal lbProcedure *lb_create_procedure(lbModule *m, Entity *entity, bool i
lb_add_proc_attribute_at_index(p, offset+parameter_index, "noalias");
}
if (e->flags&EntityFlag_NoCapture) {
lb_add_proc_attribute_at_index(p, offset+parameter_index, "nocapture");
if (is_type_internally_pointer_like(e->type)) {
lb_add_proc_attribute_at_index(p, offset+parameter_index, "nocapture");
}
}
parameter_index += 1;
}