-
Notifications
You must be signed in to change notification settings - Fork 414
[WIP] Interrealm take 2 #4028
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
[WIP] Interrealm take 2 #4028
Conversation
🛠 PR Checks SummaryAll Automated Checks passed. ✅ Manual Checks (for Reviewers):
Read More🤖 This bot helps streamline PR reviews by verifying automated checks and providing guidance for contributors and reviewers. ✅ Automated Checks (for Contributors):No automated checks match this pull request. ☑️ Contributor Actions:
☑️ Reviewer Actions:
📚 Resources:Debug
|
Codecov ReportAttention: Patch coverage is 📢 Thoughts on this report? Let us know! |
@@ -1970,15 +1970,44 @@ func (m *Machine) PushForPointer(lx Expr) { | |||
} | |||
|
|||
func (m *Machine) PopAsPointer(lx Expr) PointerValue { |
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.
Comment should say, pop a pointer for writing. All calls to this will end up writing to it.
@@ -152,17 +159,13 @@ func (m *Machine) doOpStar() { | |||
tv.SetUint8(dbv.GetByte()) | |||
m.PushValue(tv) | |||
} else { | |||
if pv.TV.IsUndefined() && bt.Elt.Kind() != InterfaceKind { |
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.
this is vestigial; unless interface value, TV is never undefined, it at least has the concrete value set by defaultValue().
lvu := lv.IsUndefined() | ||
rvu := rv.IsUndefined() | ||
lvu := lv.IsUndefined2() | ||
rvu := rv.IsUndefined2() |
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.
after this in separate PR will convert all IsDefined() to IsDefined2().
if xvdt, ok := xv.T.(*DeclaredType); ok && | ||
xvdt.PkgPath == m.Realm.Path { | ||
// Except allow if xv.T is m.Realm. | ||
// XXX do we need/want this? |
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.
What could go wrong?
replaced by #4060 |
This replaces the previous interrealm spec.
UPDATE: there are three branches in a chain.
See document for interrealm rules. https://github.com/gnolang/gno/blob/heapitems_for_3693/docs/resources/gno-interrealm.md.
heapitems_for_3696 is now effectively the main branch, as it contains a lot of fixes and changes to the VM. Please rebase there.
TODO: update gno-interrealm.md with readonly protection rules from this PR.
This PR is for 1,2 above.
For 3,4 see #4037 and #4060