Running angie on this code:
1 int main(void)
2 {
3 int *p = malloc(sizeof *p);
4 free(p);
5 free(p);
6
7 return 0;
8 }
Results in
terminate called after throwing an instance of 'NotSupportedException'
what(): attempted to call unknown function -- either an unsupported stdlib function or missing definition
The problem is that #include <stdlib.h> is missing and calls to free are wrapped in ConstExpr due to unknown prototype, e.g.:
call i32 (i32*, ...) bitcast (i32 (...)* @free to i32 (i32*, ...)*)(i32* %7)
Adding #include<stdlib.h> fixes the problem:
$./angie -f db.ll
Error: Program tried to free an already freed memory.
Running angie on this code:
Results in
The problem is that
#include <stdlib.h>is missing and calls tofreeare wrapped in ConstExpr due to unknown prototype, e.g.:Adding
#include<stdlib.h>fixes the problem: