aboutsummaryrefslogtreecommitdiffstats
path: root/src/bytecode/chunk.h
diff options
context:
space:
mode:
authorBad Diode <bd@badd10de.dev>2021-10-23 20:30:56 +0200
committerBad Diode <bd@badd10de.dev>2021-10-23 20:30:56 +0200
commit8aa57dd5a87b454ce99a336ed86a6bd4d6f77c1e (patch)
treed432226eba0aa3218a64314f702d17ac155a1f22 /src/bytecode/chunk.h
parentb271ce1d9098c9057fccdca6eba6b0ee0a5245a2 (diff)
downloadbdl-8aa57dd5a87b454ce99a336ed86a6bd4d6f77c1e.tar.gz
bdl-8aa57dd5a87b454ce99a336ed86a6bd4d6f77c1e.zip
Add string and symbol types
Diffstat (limited to 'src/bytecode/chunk.h')
-rwxr-xr-xsrc/bytecode/chunk.h6
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) {
32void 32void
33chunk_free(Chunk *chunk) { 33chunk_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);