Skip to content

Fix ClearFlag indexing and flag-range diagnostics - #929

Open
jacobyen-2001 wants to merge 1 commit into
form-dev:masterfrom
jacobyen-2001:fix-clearflag-index-855
Open

jacobyen-2001 wants to merge 1 commit into
form-dev:masterfrom
jacobyen-2001:fix-clearflag-index-855

Conversation

@jacobyen-2001

Copy link
Copy Markdown

ClearFlag compiled the user-facing flag number directly, although flag operations store zero-based bit indices. For example, ClearFlag 5 cleared flag 6. Compile x - 1, matching SetFlag and the preprocessor flag operations.

The out-of-range diagnostics in both SetFlag and ClearFlag also omitted the flag-number argument to MesPrint. Supply it so the two format placeholders receive valid arguments.

Validation: all three new regressions fail before the change and pass afterward in both FORM and TFORM. They check that clearing several flags preserves their neighbors and that invalid flag diagnostics report the supplied number. The complete standard suites ran 563 tests each, with zero failures/errors (FORM: 9 platform omissions; TFORM: 3 existing pendings and 4 omissions). Built on macOS arm64 with GMP and MPFR enabled, without FLINT.

Fixes #855.

Implemented and tested by OpenAI Codex at the account owner's request.

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.

ClearFlag clears a wrong flag

1 participant