diff options
author | Preston Pan <preston@nullring.xyz> | 2024-01-09 12:04:19 -0800 |
---|---|---|
committer | Preston Pan <preston@nullring.xyz> | 2024-01-09 12:04:19 -0800 |
commit | 0cfcbe979277f6d3b096b85d7fb6f4c02c366c72 (patch) | |
tree | bce0a91a88459050f9ba793796af440ec66b5c83 /main.c | |
parent | dfe729c98b63d0f6c0041799a0fb46b2f476502e (diff) |
fix invalid read/write of size 1; add framework for custom structs
Diffstat (limited to 'main.c')
-rw-r--r-- | main.c | 10 |
1 files changed, 6 insertions, 4 deletions
@@ -1,16 +1,18 @@ #include "builtins.h" #include "parser.h" +#include <dlfcn.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <unistd.h> + 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); |