-
Notifications
You must be signed in to change notification settings - Fork 97
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
viper: associate the first exhale
with the async
expression
#3524
Conversation
src/viper/trans.ml
Outdated
!!(SeqnS ( | ||
let (!!) p = !!! at p in | ||
!!([], | ||
!@(ExhaleS (!@(AndE(!@(MacroCall("$Perm", self ctxt at)), |
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 the relevant change, sorry for the other noise...
(self ctxt Source.no_region, !!id), | ||
(!!(AddE(!!(FldAcc (self ctxt (s.at), !!id)), | ||
intLitE Source.no_region 1))))); | ||
!@(ExhaleS (!@(AndE(!@(MacroCall("$Perm", self ctxt at)), |
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 the relevant change, sorry for the other noise...
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.
!!
still marks up the await
, but !@
points at the async
.
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.
Right but doesn't the exhale belong to the await, not the async? This is when you need to establish the invariant before suspending. That was my thinking at least. But I don't know why it doesn't highlight the await rather than default to the unknow region.
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.
I think the exhale
is due to the async
being filed into the continuation table. But you are right, that only the await
opens up the context switch so that a havoc can occur. I.e. a totally unrelated async
could be it too.
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.
I'm not sure this is correct, but I'll approve for the sake of the demo. Maybe just add a comment to review this later.
(self ctxt at, !@id), | ||
(!@(SubE(!@(FldAcc (self ctxt at, !@id)), | ||
intLitE at 1))))); | ||
!!! (e.at) (SeqnS stmts); |
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.
Is this maybe confusing things and should really be !@
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.
Not so sure.
Not needed for the demo and I won't merge right now. This can wait. |
This changes the srcloc of certain Viper subexpression to better track the original Motoko.