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

Expand casted macros that include this.* #144

Open
matt-sheets opened this issue Mar 16, 2023 · 0 comments
Open

Expand casted macros that include this.* #144

matt-sheets opened this issue Mar 16, 2023 · 0 comments
Milestone

Comments

@matt-sheets
Copy link
Collaborator

If we have a function like:

fn read_boo_this_tmp(domain source) {
    allow(source, this.tmp, file, [read]);
}

And call jkl<boo>.read_boo_this_tmp(this) we want this.tmp to resolve to jkl-tmp, but currently the only macro that is made for read_boot_this_tmp is (macro boo-read_boo_this_tmp ((type this) (type source)) (allow source boo-tmp (file (read)))).

Thus we will need to create a new macro for each casted call to have the correct this.* resolution. In the above case:
(macro jkl-read_boo_this_tmp ((type this) (type source)) (allow source jkl-tmp (file (read))))

Some more wordage from dburgener:

The macros come from the FunctionInfos. Each FunctionInfo creates exactly one macro from that fi. So in order to create a new macro, you'd want to make a copy of the original FunctionInfo, with changes as needed and then add it into the FunctionMap, then everything else proceeds from there. Ideally we'd make the name of the macro be something with reserved characters so it can't possibly be explicitly referred to in the source, but also something at least vaguely sensible to someone interacting at the CIL level, for cross-language compatibility purposes. (Although, we're definitely going to need some sort of shim for that aspect in the long run I think. There's probably not a solution to the cross-language aspect that's 100% as clean as we'd like)

This should be done as part of 0.1

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

No branches or pull requests

2 participants