Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/group.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -862,6 +862,11 @@ void Group::GenerateEquations(IdList<Equation,hEquation> *l) {
hEntity Group::Remap(hEntity in, int copyNumber) {
auto it = remap.find({ in, copyNumber });
if(it == remap.end()) {
// Due to the way the remap value is combined with the group handle into a 32-bit
// handle value to generate an entity handle, the mapped value must fit in a 16-bit
// variable.
// This limit can be lifted once the handle values are extended to 64-bit.
ssassert(remap.size() < (1 << 16) - 1, "Too many entities in group");
std::tie(it, std::ignore) =
remap.insert({ { in, copyNumber }, { (uint32_t)remap.size() + 1 } });
}
Expand Down
2 changes: 1 addition & 1 deletion src/sketch.h
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ struct IsHandleOracle<EntityId> : std::true_type {};
struct EntityKey {
hEntity input;
int copyNumber;
// (input, copyNumber) gets mapped to ((Request)xxx).entity(h.v)
// (input, copyNumber) gets mapped to hGroup::entity(i)
};
struct EntityKeyHash {
size_t operator()(const EntityKey &k) const {
Expand Down