Opened 9 years ago
Closed 9 years ago
#9 closed defect (fixed)
Unconstrained dtype return values are closed in unification
| Reported by: | Rob Schluntz | Owned by: | Rob Schluntz |
|---|---|---|---|
| Priority: | major | Component: | cfa-cc |
| Version: | 1.0 | Keywords: | dtype unify unification malloc return |
| Cc: |
Description (last modified by )
#include <stdlib>
int main() {
int * i;
i = malloc();
}
cfa test.c
CFA Version 1.0.0 (debug)
test.c:2 error: Types:
_2_DT -> instance of type _71_T (not function type)
_36_DT -> signed int
Non-types:
unbound type variable: _71_T in application Application of
Variable Expression: malloc: forall
T: sized incomplete type
function
returning
_retval_malloc: pointer to instance of type T (not function type)
The dtype T is only used as the return value of malloc, i.e., T does not occur in the parameter list or any type assertion (other than the pseudo-assertion "sized"), so by the time it is seen in the assignment call ?=?(&i, malloc()) T is a closed type variable and the unification of T and int* fails.
Change History (2)
comment:1 by , 9 years ago
| Description: | modified (diff) |
|---|
comment:2 by , 9 years ago
| Resolution: | → fixed |
|---|---|
| Status: | assigned → closed |
Note:
See TracTickets
for help on using tickets.
Fixed by commit 7f623d6fc2334cda8b26a77d059a48637fb5a398