Revise SafeRefs checking to make it work for inlined defs#26154
Open
odersky wants to merge 1 commit into
Open
Conversation
71a155b to
1f072dd
Compare
We want to check the call of an inline def for safe references, not the expansion. To do this, we need to move safe reference checking earlier, where inlining has not yet happened or the original call of an Inline node is still available. This means moving it to PostTyper.
bishabosha
reviewed
May 26, 2026
| /** Check whether references from safe mode should be allowed */ | ||
| object SafeRefs { | ||
|
|
||
| val assumedSafePackages = List( |
Member
There was a problem hiding this comment.
question unrelated to this PR: i guess package declarations haven't been a super important security hole to consider because TACIT runs in a repl, but i guess the current recommendation is that a harness should scan classfiles for execution to check that they arent declared in one of these packages
Contributor
Author
There was a problem hiding this comment.
This kind of sandboxing is not handled by our scheme. It's not so easy to set up since a classfile can be loaded indirectly from an asuumed-safe entry point.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
We want to check the call of an inline def for safe references, not the expansion. To do this, we need to move safe reference checking earlier, where inlining has not yet happened or the original call of an Inline node is still available. This means moving it to PostTyper.
Fixes #25387