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

Defer unresolvable calls up the call stack until they are resolvable #202

Merged
merged 9 commits into from
May 2, 2023

Conversation

dburgener
Copy link
Owner

No description provided.

@dburgener dburgener force-pushed the dburgener/call-tree branch from 34edc4b to b79e8b6 Compare May 1, 2023 17:43
@github-actions
Copy link

github-actions bot commented May 1, 2023

Stable clippy has failed for this run: nightly. A maintainer should check the logs. If known good clippy passed, this is non-fatal to the PR.

src/compile.rs Show resolved Hide resolved
src/functions.rs Show resolved Hide resolved
src/functions.rs Show resolved Hide resolved
src/functions.rs Outdated Show resolved Hide resolved
data/expected_cil/arg_call.cil Show resolved Hide resolved
src/functions.rs Outdated Show resolved Hide resolved
@dburgener dburgener force-pushed the dburgener/call-tree branch 2 times, most recently from f2a1b92 to 92da203 Compare May 2, 2023 12:26
dburgener added 4 commits May 2, 2023 08:27
This will be helpful for two purposes:

1. Function calls based on macros can't be calculated by CIL, so we need
to pull them up the stack and resolve them ourselves.
2. Certain validations CIL does after macro resolution aren't tracked by
Cascade's type system (for example object class/perm compatibility), so
we need to validate them up the call stack.
A comment here is just a regular Atom that starts with a ';'.
sexp_internal surrounds it with newlines, so only that specific atom is
commented out.

Care should be taken if comments are inserted in lists, because they
could change the number of arguments, potentially resulting in invalid
CIL.

nb sexp doesn't natively support comments.  CIL's use of sexp supports
lisp-style comments starting with ";"
Put comments in the output at the source of a deferred statement for
information and debugging
This comment exists somewhere else where it is accurate
@dburgener dburgener force-pushed the dburgener/call-tree branch from 92da203 to 1c57b45 Compare May 2, 2023 12:28
@dburgener
Copy link
Owner Author

FYI, I'm seeing a regression in refpolicy3 compile on this branch, probably introduced by 4460f42. Will try to get that sorted out and notify here once it's fixed.

@dburgener
Copy link
Owner Author

I think I've got it sorted out. Basically another bug related to the lack of #201.

My fix passes initial smoke testing. I'm doing slightly more time-expensive testing now and will push once it passes.

dburgener added 4 commits May 2, 2023 11:17
This allows let bindings to be resolved, and allows for future argument
handling.  See the update to let.cas in this commit for an example of
what this enables by itself
If we can't resolve the right macro at the call-site, we propagate it up
the call stack, resolving arguments as we go, until we can resolve the
right call name at compile time.
This commit also fixes a logic bug, where we returned after finding the
first end of deferrals, rather than searching for more
@dburgener dburgener force-pushed the dburgener/call-tree branch from 1c57b45 to e53c0ab Compare May 2, 2023 15:17
@dburgener
Copy link
Owner Author

Pushed the fix. The change is in the commit now hashed as 3178681

@dburgener dburgener force-pushed the dburgener/call-tree branch from 77c87d9 to f9413d9 Compare May 2, 2023 16:40
@dburgener dburgener merged commit 8b6d08c into main May 2, 2023
@dburgener dburgener deleted the dburgener/call-tree branch May 2, 2023 16:52
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.

2 participants