Skip to content
Snippets Groups Projects
Commit 2454f640 authored by Regis Blanc's avatar Regis Blanc
Browse files

quick fix for old keyword

parent c9f89c95
No related branches found
No related tags found
No related merge requests found
...@@ -25,7 +25,23 @@ object ImperativeCodeElimination extends UnitPhase[Program] { ...@@ -25,7 +25,23 @@ object ImperativeCodeElimination extends UnitPhase[Program] {
} { } {
val (res, scope, _) = toFunction(body)(State(fd, Set(), Map())) val (res, scope, _) = toFunction(body)(State(fd, Set(), Map()))
fd.body = Some(scope(res)) fd.body = Some(scope(res))
} }
//probably not the cleanest way to do it, but if somehow we still have Old
//expressions at that point, they can be safely removed as the object is
//equals to its original value
for {
fd <- pgm.definedFunctions
} {
fd.postcondition = fd.postcondition.map(post => {
preMap{
case Old(v) => Some(v.toVariable)
case _ => None
}(post)
})
}
} }
/* varsInScope refers to variable declared in the same level scope. /* varsInScope refers to variable declared in the same level scope.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment