Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: 'AwkwardForth testing E' should use the last fields/formats, not first #1224

Merged
merged 2 commits into from
May 24, 2024

Conversation

jpivarski
Copy link
Member

We've never before had a C++ class with members in the following pattern:

  1. some basic type (int, float, bool...)
  2. some not basic type (string, collection, class...)
  3. more than one basic types

but it came up in #1221. It revealed a bug in which AwkwardForth statements are supposed to be generated from the last fields/formats list to be filled (these variables are both lists of lists), but the old code was looking at the first.

This was in the "AwkwardForth testing E" block, for the case in which there's more than just one fields/formats.

  • If part 3 (above) has no more than one basic type, then we'd be in "AwkwardForth testing D", which was correct (fields[-1][0] and formats[-1][0], with the -1 in the first index).
  • If there was no part 1 (above), then fields[0] is fields[-1] and formats[0] is formats[-1], and it worked by accident.

All of the tests/test_0637_setup_tests_for_AwkwardForth.py tests are insensitive to the code change, so this case doesn't exist in our test suite. It would be great to get example files from #1221 and add them to our test suite.

@jpivarski jpivarski enabled auto-merge (squash) May 24, 2024 05:24
@jpivarski jpivarski merged commit 734700e into main May 24, 2024
24 checks passed
@jpivarski jpivarski deleted the jpivarski/last-formats-not-first branch May 24, 2024 05:33
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.

'read beyond' in AwkwardForth error when reading vector<vector<object>> branch
1 participant