aboutsummaryrefslogtreecommitdiff
path: root/src/parse.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/parse.c')
-rw-r--r--src/parse.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/parse.c b/src/parse.c
index ff01bf0..6e08d2e 100644
--- a/src/parse.c
+++ b/src/parse.c
@@ -127,7 +127,9 @@ static struct term *rec_bloc(struct term *term, struct bloc_parsed *bloc)
fprintf(stderr, "invalid entry reference\n");
return 0;
}
- memcpy(term, bloc->entries[term->u.ref.index], sizeof(*term));
+ memcpy(term,
+ bloc->entries[bloc->length - term->u.ref.index - 1],
+ sizeof(*term));
break;
default:
fprintf(stderr, "invalid type %d\n", term->type);