Skip to content

Commit

Permalink
Add out-of-bounds check
Browse files Browse the repository at this point in the history
  • Loading branch information
tygyh committed Sep 12, 2024
1 parent f84c1fb commit 32384a3
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions spirv_cross_parsed_ir.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -928,6 +928,9 @@ void ParsedIR::reset_all_of_type(Types type)

void ParsedIR::add_typed_id(Types type, ID id)
{
if (id == ids.size())
return;

if (loop_iteration_depth_hard != 0)
SPIRV_CROSS_THROW("Cannot add typed ID while looping over it.");

Expand Down

0 comments on commit 32384a3

Please sign in to comment.