Skip to content

Properly set and read is_ref in delegate.hpp to fix non-$this variable source components in query iteration#1327

Merged
SanderMertens merged 3 commits into
SanderMertens:masterfrom
Gaspard--:fix_cpp_term_source
Sep 1, 2024
Merged

Properly set and read is_ref in delegate.hpp to fix non-$this variable source components in query iteration#1327
SanderMertens merged 3 commits into
SanderMertens:masterfrom
Gaspard--:fix_cpp_term_source

Conversation

@Gaspard--

Copy link
Copy Markdown
Contributor
  • set is_ref in populate_self so that it's properly set for any type of query
  • always set row to 0 for components with is_ref to avoid indexing garbage

Fixes #1324

…e source components in query iteration

- set is_ref in populate_self so that it's properly set for any type of query
- always set row to 0 for components with is_ref to avoid indexing garbage

Fixes SanderMertens#1324
@SanderMertens

Copy link
Copy Markdown
Owner

Nice! Can you:

  • Add a test case that reproduces the bug
  • Run bake once on the repository so the distr/flecs.h files get updated? (this is what's causing CI to fail)

@Gaspard--

Copy link
Copy Markdown
Contributor Author

I tried to cover some range of scenarios in the test. Didn't add optional arguments because I felt like the test was getting a bit long.

@SanderMertens

Copy link
Copy Markdown
Owner

Thanks, almost there:

  • Can you split up the test into three individual test cases?
  • You'll need to add the test cases to the test/cpp/project.json file for them to be executed

@Gaspard--

Copy link
Copy Markdown
Contributor Author

I thought about is some more and I'm pretty sure these 2 tests cover all cases. I wanted to make sure reading / writing relationships was consistent originally, but I'm pretty sure that superfluous.

@SanderMertens

Copy link
Copy Markdown
Owner

Thanks for the PR!

@SanderMertens SanderMertens merged commit 7922011 into SanderMertens:master Sep 1, 2024
@Gaspard-- Gaspard-- deleted the fix_cpp_term_source branch September 1, 2024 22:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Source is not properly taken into account when iterating with the C++ API

2 participants