aboutsummaryrefslogtreecommitdiff
path: root/typecheck.c
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2024-07-26 13:28:18 -0400
committerBruce Hill <bruce@bruce-hill.com>2024-07-26 13:28:18 -0400
commitcfe46ee393aa3c9a2344a916bccfc4a69d4b8b77 (patch)
treea5953090e0cb9c9d66b622d91012111ab30a89ea /typecheck.c
parent87785555eca3b7166d5f1af658a08f58a64340ed (diff)
Replace heap_strn() with GC_strndup()
Diffstat (limited to 'typecheck.c')
-rw-r--r--typecheck.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/typecheck.c b/typecheck.c
index 0dc7cdc0..52af8371 100644
--- a/typecheck.c
+++ b/typecheck.c
@@ -22,7 +22,7 @@ type_t *parse_type_ast(env_t *env, type_ast_t *ast)
type_t *t = Table$str_get(*env->types, name);
if (t) return t;
while (strchr(name, '.')) {
- char *module_name = heap_strn(name, strcspn(name, "."));
+ char *module_name = GC_strndup(name, strcspn(name, "."));
binding_t *b = get_binding(env, module_name);
if (!b || b->type->tag != ModuleType)
code_err(ast, "I don't know a module with the name '%s'", module_name);
@@ -139,7 +139,7 @@ static env_t *load_module(env_t *env, ast_t *module_ast)
*module_env->libname = (CORD)libname_id;
for (int64_t i = 1; i <= files_f->num_lines; i++) {
const char *line = get_line(files_f, i);
- line = heap_strn(line, strcspn(line, "\r\n"));
+ line = GC_strndup(line, strcspn(line, "\r\n"));
if (!line || line[0] == '\0') continue;
const char *tm_path = resolve_path(line, resolved_path, ".");
if (!tm_path) errx(1, "Couldn't find library %s dependency: %s", libname, line);