Skip to content

Commit

Permalink
increase RESERVATION_AMOUNT to avoid parsing error (fixes #29)
Browse files Browse the repository at this point in the history
  • Loading branch information
falkoschindler committed Feb 23, 2024
1 parent ecafb01 commit 050d9b7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion gen_parser.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,11 @@ then
exit 1
fi

# remove minimum size of 4096 bytes
# remove minimum size of 4096 bytes (see https://github.com/zauberzeug/lizard/issues/23)
sed -i '' 's/while (n < size \|\| n < 4096)/while (n < size)/g' main/parser.h

# increase RESERVATION_AMOUNT to 11 (see https://github.com/zauberzeug/field_friend/issues/7)
sed -i '' 's/#define RESERVATION_AMOUNT 10/#define RESERVATION_AMOUNT 11/g' main/parser.h
else
echo "Nothing to do."
fi
2 changes: 1 addition & 1 deletion main/parser.h
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,7 @@ struct owl_tree {
size_t next_number_token_offset;
};
// Reserve 10 bytes for each entry (the maximum encoded size of a 64-bit value).
#define RESERVATION_AMOUNT 10
#define RESERVATION_AMOUNT 11
static inline uint64_t read_tree(size_t *offset, struct owl_tree *tree) {
uint8_t *parse_tree = tree->parse_tree;
size_t parse_tree_size = tree->parse_tree_size;
Expand Down

0 comments on commit 050d9b7

Please sign in to comment.