Skip to content

Commit

Permalink
Add assert in MultivarJson::select
Browse files Browse the repository at this point in the history
  • Loading branch information
Bronek committed Oct 20, 2023
1 parent 1f26905 commit e6ea67d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/ripple/json/MultivarJson.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,9 @@ struct MultivarJson
select(auto&& selector) const
requires std::same_as<std::size_t, decltype(selector())>
{
return val[selector()];
auto const index = selector();
assert(index < size);
return val[index];
}

void
Expand Down

0 comments on commit e6ea67d

Please sign in to comment.