mirror of
https://github.com/pnx/m16vm
synced 2026-07-02 11:33:40 +02:00
src/as/ast.c: bug in ast_free(). we should advance i by sizeof(char**).
This commit is contained in:
parent
3513662ad8
commit
1a29b39663
1 changed files with 1 additions and 1 deletions
|
|
@ -17,7 +17,7 @@ void ast_free(struct ast* ast) {
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
// Free all label strings
|
// Free all label strings
|
||||||
for(int i = 0; i < ast->labels.size; i++) {
|
for(int i = 0; i < ast->labels.size; i += sizeof(char**)) {
|
||||||
char *ptr = *((char**) ast->labels.base + i);
|
char *ptr = *((char**) ast->labels.base + i);
|
||||||
free(ptr);
|
free(ptr);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue