-
Notifications
You must be signed in to change notification settings - Fork 215
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: detect cycles in globals #6859
Conversation
Peak Memory Sample
|
Compilation Sample
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One thought, but LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. I don't see a way to avoid the double error, and double errors are already common when running comptime code. To avoid them we'd have to return something like Result<_, Option<Error>>
which would get messy.
I was thinking of another way to do this, which is to do it similarly to pub enum FunctionBody {
Unresolved(FunctionKind, BlockExpression, Span),
Resolving,
Resolved,
} So a global's value would be a similar enum, and we wouldn't have to add a field to the interpreter. But I don't know which way is preferred... |
Either is fine, and either way you'd have to issue an extra error still |
I just pushed a change for that. I think the code ends up a bit more clear, as it kind of forces us to handle the different states of a global's value. |
Execution Sample
|
* master: fix: detect cycles in globals (#6859) chore(ci): Execution time report (#6827) chore(ci): Add non determinism check and fixes (#6847) chore(docs): updating the solidity contract how-to guide (#6804) fix: double alias in path (#6855) feat: configurable external check failures (#6810) chore: move constant creation out of loop (#6836) fix: implement `as_field` and `from_field` in the interpreter (#6829) chore: Use Vec for callstacks (#6821) feat: replace `eval_global_as_array_length` with type/interpreter evaluation (#6469) chore: refactor `DataFlowGraph.insert_instruction_and_results` (#6823) chore(docs): updating noirjs tutorial for 1.0.0 (#6792)
Description
Problem
Resolves #6780
Summary
This program:
now gives these errors:
Additional Context
Documentation
Check one:
PR Checklist
cargo fmt
on default settings.