aboutsummaryrefslogtreecommitdiff
path: root/src/scope.c
diff options
context:
space:
mode:
authorKimplul <kimi.h.kuparinen@gmail.com>2026-05-01 20:35:00 +0300
committerKimplul <kimi.h.kuparinen@gmail.com>2026-05-01 22:16:26 +0300
commit8946c27306abed7065afad3f015df5ee81e72ad2 (patch)
treec53c9a2c0437109e9c1e3f873bf8a54220ee5ded /src/scope.c
parent7790e27b3423901e2080bfd3c600a65a48d42886 (diff)
downloadfwd-8946c27306abed7065afad3f015df5ee81e72ad2.tar.gz
fwd-8946c27306abed7065afad3f015df5ee81e72ad2.zip
add support for coverage
Diffstat (limited to 'src/scope.c')
-rw-r--r--src/scope.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/src/scope.c b/src/scope.c
index 251edef..f350090 100644
--- a/src/scope.c
+++ b/src/scope.c
@@ -14,6 +14,7 @@
#include <stdio.h>
#include <dlfcn.h>
+#include <fwd/coverage.h>
#include <fwd/debug.h>
#include <fwd/scope.h>
@@ -22,7 +23,7 @@ struct scope *create_scope()
/* if I ever try making the parser multithreaded, this should be atomic. */
static size_t counter = 0;
- struct scope *scope = calloc(1, sizeof(struct scope));
+ struct scope *scope = callocc(1, sizeof(struct scope));
if (!scope) {
internal_error("ran out of memory allocating scope");
return NULL;
@@ -42,11 +43,6 @@ void destroy_scope(struct scope *scope)
if (!scope)
return;
- if (!scope->parent) {
- free((void *)scope->fctx.fbuf);
- free((void *)scope->fctx.fname);
- }
-
foreach(mod_vec, m, &scope->mods) {
dlclose(*m);
}