Queries with Or terms and wildcard terms cause internal error
nimble0 opened this issue · comments
nimble0 commented
Describe the bug
Certain combinations of Or terms and wildcard terms trigger an internal error assert.
To Reproduce
#include <basics.h>
#include <iostream>
struct Position {
double x, y;
};
int main(int, char *[]) {
flecs::world ecs;
auto tag1 = ecs.entity("tag1");
auto tag2 = ecs.entity("tag2");
auto tag3 = ecs.entity("tag3");
auto tag4 = ecs.entity("tag4");
ecs.entity("e1")
.add(tag1)
.set(tag3, Position{10, 20})
.set(tag4, Position{10, 20});
ecs.filter_builder()
.term(tag1)
.or_().term(tag2)
.term().first<Position>().second(flecs::Wildcard).in()
.build()
.iter([](flecs::iter& iter)
{
for(auto i : iter)
std::cout<<iter.entity(i)<<"\n";
});
}
Result
fatal: filter.c: 3205: assert: i >= 0 INTERNAL_ERROR
Additional context
This started with 0ec4e06
Sander Mertens commented
Fixed!