Skip to content

fix: reject non-concrete eq/ne/not in const evaluation#9877

Open
s0mnathh wants to merge 1 commit into
starkware-libs:mainfrom
s0mnathh:fix-const-eval-non-concrete-bool-ops
Open

fix: reject non-concrete eq/ne/not in const evaluation#9877
s0mnathh wants to merge 1 commit into
starkware-libs:mainfrom
s0mnathh:fix-const-eval-non-concrete-bool-ops

Conversation

@s0mnathh

Copy link
Copy Markdown
Contributor

Summary

Reject non-concrete equality, inequality, and logical-not operations during constant evaluation. Add a regression test for !F::FLAG on generic impl constants and report E2127 instead of folding the expression.


Type of change

Please check one:

  • Bug fix (fixes incorrect behavior)
  • New feature
  • Performance improvement
  • Documentation change with concrete technical impact
  • Style, wording, formatting, or typo-only change

Why is this change needed?

Generic impl constants are not fully concrete during constant evaluation, so ==, !=, and ! should not be folded eagerly. Before this change these operators could bypass the existing non-concrete checks and produce an incorrect boolean result instead of a diagnostic.


What was the behavior or documentation before?

Constant evaluation could accept equality, inequality, or logical-not expressions over generic impl constants and fold them as if the value were known. This could silently produce the wrong constant result instead of reporting E2127.


What is the behavior or documentation after?

The evaluator now reports E2127 for ==, !=, and ! when any argument is a non-concrete impl constant. The regression test covers !F::FLAG and verifies that unsupported constant expressions are rejected.


Related issue or discussion (if any)


Additional context

This follows the same constant-evaluation policy already used for other unsupported operations on generic impl constants and keeps the fix scoped to the boolean operator fast path.

@reviewable-StarkWare

Copy link
Copy Markdown

This change is Reviewable

@orizi orizi left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@orizi reviewed all commit messages and made 1 comment.
Reviewable status: 0 of 2 files reviewed, 1 unresolved discussion (waiting on s0mnathh).


a discussion (no related file):
fixed by #9879

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.

3 participants