Fix badly freed pointer on indented code block after rept (#189)

This commit is contained in:
Fighter19 2023-05-13 06:13:44 +02:00 committed by GitHub
parent fa9e004383
commit 529c14bfdc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -979,10 +979,11 @@ static int eval_rept(yasm_preproc_gas *pp, int unused, const char *arg1)
SLIST_INIT(&lines);
while (line) {
skip_whitespace2(&line);
if (starts_with(line, ".rept")) {
char *line2 = line;
skip_whitespace2(&line2);
if (starts_with(line2, ".rept")) {
nesting++;
} else if (starts_with(line, ".endr") && --nesting == 0) {
} else if (starts_with(line2, ".endr") && --nesting == 0) {
for (i = 0; i < n; i++) {
buffered_line *current_line;
prev_bline = NULL;