You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In C we can declare variables inside a loop and take the address of these variables. If we do that, the variable will be replaced by a pointer. In the VariableToPointer pass we add a method call to inhale permission to access the pointer at the start of the Scope (meaning the Scope COL node) where it is declared. Unfortunately, since the Scope containing LocalDecl is empty until the CollectLocalDeclarations pass the Scope node is removed by the PrettifyBlocks pass. Therefore the permission for the pointer is inhaled in the scope outside of the loop which means that the permission is not available inside the loop since it isn't included in the loop invariant.
The solution will probably be to either keep the Scopes around for longer, automatically re-add the Scope if we happen to be inside of a Loop, or we move VariableToPointer before CollectLocalDeclarations and do the initialisation for LocalDecls as well as Scopes.
Crash Message
An error condition was reached, which should be statically unreachable. Assigning to a local can never fail.. Inner failure:
> ======================================
> At /tmp/vercors-interpreted-17040729019032010151.i
> --------------------------------------
> 8 int main() {
> 9 while (0 == 0) {
> [------
> 10 int p = 10;
> ------]
> 11 int *pp = &p;
> 12 p = 5;
> --------------------------------------
> At /home/alexander/vercors-2/test.c
> --------------------------------------
> 1 int main() {
> 2 while (0 == 0) {
> [---------------------
> 3 int p = 10;
> ---------------------]
> 4 int *pp = &p;
> 5 p = 5;
> --------------------------------------
> Insufficient permission to assign to field. (https://utwente.nl/vercors#assignFieldFailed)
> ======================================
In C we can declare variables inside a loop and take the address of these variables. If we do that, the variable will be replaced by a pointer. In the
VariableToPointer
pass we add a method call to inhale permission to access the pointer at the start of theScope
(meaning theScope
COL node) where it is declared. Unfortunately, since theScope
containingLocalDecl
is empty until theCollectLocalDeclarations
pass theScope
node is removed by thePrettifyBlocks
pass. Therefore the permission for the pointer is inhaled in the scope outside of the loop which means that the permission is not available inside the loop since it isn't included in the loop invariant.The solution will probably be to either keep the
Scope
s around for longer, automatically re-add theScope
if we happen to be inside of aLoop
, or we moveVariableToPointer
beforeCollectLocalDeclarations
and do the initialisation forLocalDecl
s as well asScope
s.Crash Message
File Inputs
/home/alexander/vercors-2/test.c
The text was updated successfully, but these errors were encountered: