From 0cfcbe979277f6d3b096b85d7fb6f4c02c366c72 Mon Sep 17 00:00:00 2001 From: Preston Pan Date: Tue, 9 Jan 2024 12:04:19 -0800 Subject: fix invalid read/write of size 1; add framework for custom structs --- main.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'main.c') diff --git a/main.c b/main.c index 68e093e..fe3bb2a 100644 --- a/main.c +++ b/main.c @@ -1,16 +1,18 @@ #include "builtins.h" #include "parser.h" +#include #include #include #include #include + extern ht_t *WORD_TABLE; extern array_t *STACK; extern char *INBUF; extern parser_t *PARSER; extern array_t *EVAL_STACK; -extern ht_t *OBJ_FREE_TABLE; +extern ht_t *OBJ_TABLE; extern ht_t *FLIT; void usage() { @@ -20,7 +22,7 @@ void usage() { void version() { printf("Author: Preston Pan, MIT License 2023\n"); - printf("stem, version 1.1\n"); + printf("stem, version 1.2 alpha\n"); exit(0); } @@ -55,7 +57,7 @@ int main(int argc, char **argv) { WORD_TABLE = init_ht(500); EVAL_STACK = init_array(10); FLIT = init_ht(500); - OBJ_FREE_TABLE = init_ht(500); + OBJ_TABLE = init_ht(500); add_funcs(); @@ -69,7 +71,7 @@ int main(int argc, char **argv) { free(INBUF); ht_free(WORD_TABLE, value_free); ht_free(FLIT, func_free); - ht_free(OBJ_FREE_TABLE, func_free); + ht_free(OBJ_TABLE, custom_free); array_free(STACK); free(PARSER); array_free(EVAL_STACK); -- cgit