projects
/
ned1
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
tags
|
clone url
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
d587e60
)
Fixed bug in nedasm related to uninitialized size of text_segment array.
author
Aaron Taylor
<ataylor@subgeniuskitty.com>
Tue, 10 Sep 2019 01:14:48 +0000
(18:14 -0700)
committer
Aaron Taylor
<ataylor@subgeniuskitty.com>
Tue, 10 Sep 2019 01:14:48 +0000
(18:14 -0700)
nedasm/nedasm_codegen.c
patch
|
blob
|
blame
|
history
diff --git
a/nedasm/nedasm_codegen.c
b/nedasm/nedasm_codegen.c
index
ddfd792
..
a4e9609
100644
(file)
--- a/
nedasm/nedasm_codegen.c
+++ b/
nedasm/nedasm_codegen.c
@@
-229,6
+229,7
@@
generate_code(struct instruction * instructions, FILE * output)
uint32_t * text_segment = malloc((max_word_count * sizeof(uint32_t)) + 1);
struct nlist * symbol_table = malloc(label_count * sizeof(struct nlist));
uint32_t * text_segment = malloc((max_word_count * sizeof(uint32_t)) + 1);
struct nlist * symbol_table = malloc(label_count * sizeof(struct nlist));
+ text_segment[0] = 0;
uint8_t syllable_count = 0;
uint32_t temp_word = 0;
uint8_t syllable_count = 0;
uint32_t temp_word = 0;