diff options
Diffstat (limited to 'asm')
-rw-r--r-- | asm/parser.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/asm/parser.c b/asm/parser.c index c97028d..0830ef3 100644 --- a/asm/parser.c +++ b/asm/parser.c @@ -378,8 +378,8 @@ perr_t preprocess_use_blocks(token_stream_t *stream, token_stream_t *new) if (i + 1 >= stream->available || DARR_AT(token_t, stream->data, i + 1).type != TOKEN_LITERAL_STRING) { - stream->used = i; - for (size_t i = 0; i < new_stream.available; ++i) + stream->used = i + 1 >= stream->available ? i : i + 1; + for (size_t i = 0; i < (new_stream.available / sizeof(token_t)); ++i) free(TOKEN_STREAM_AT(new_stream.data, i).str); free(new_stream.data); return PERR_PREPROCESSOR_EXPECTED_STRING; |