Skip to content

Commit

Permalink
minor memory safeguard
Browse files Browse the repository at this point in the history
  • Loading branch information
jfrech committed Sep 23, 2022
1 parent c61c3a6 commit 2d234fb
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions libraries/llvm/buffer.c
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,8 @@ struct Pos c_buffer_construct_zeroed(const uint64_t n) {
}

void c_buffer_truncate(struct Pos buffer, const uint64_t n) {
if (n > c_buffer_length(buffer))
return;
buffer.tag = n;
}

Expand Down

0 comments on commit 2d234fb

Please sign in to comment.