diff options
author | Bad Diode <bd@badd10de.dev> | 2021-10-23 20:30:56 +0200 |
---|---|---|
committer | Bad Diode <bd@badd10de.dev> | 2021-10-23 20:30:56 +0200 |
commit | 8aa57dd5a87b454ce99a336ed86a6bd4d6f77c1e (patch) | |
tree | d432226eba0aa3218a64314f702d17ac155a1f22 /src/bytecode/chunk.h | |
parent | b271ce1d9098c9057fccdca6eba6b0ee0a5245a2 (diff) | |
download | bdl-8aa57dd5a87b454ce99a336ed86a6bd4d6f77c1e.tar.gz bdl-8aa57dd5a87b454ce99a336ed86a6bd4d6f77c1e.zip |
Add string and symbol types
Diffstat (limited to 'src/bytecode/chunk.h')
-rwxr-xr-x | src/bytecode/chunk.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/bytecode/chunk.h b/src/bytecode/chunk.h index 81fc4cc..aafa0ec 100755 --- a/src/bytecode/chunk.h +++ b/src/bytecode/chunk.h | |||
@@ -32,6 +32,12 @@ chunk_init(void) { | |||
32 | void | 32 | void |
33 | chunk_free(Chunk *chunk) { | 33 | chunk_free(Chunk *chunk) { |
34 | array_free(chunk->code); | 34 | array_free(chunk->code); |
35 | for (size_t i = 0; i < array_size(chunk->constants); i++) { | ||
36 | Object obj = chunk->constants[i]; | ||
37 | if (IS_STRING(obj) || IS_SYMBOL(obj)) { | ||
38 | array_free(obj.text); | ||
39 | } | ||
40 | } | ||
35 | array_free(chunk->constants); | 41 | array_free(chunk->constants); |
36 | array_free(chunk->lines); | 42 | array_free(chunk->lines); |
37 | free(chunk); | 43 | free(chunk); |