Commit ec913551 authored by Sergio Costas's avatar Sergio Costas

Now allows to access to parameters inside borrowed blocks

parent 0774c3d4
...@@ -396,7 +396,7 @@ class crusty(object): ...@@ -396,7 +396,7 @@ class crusty(object):
if assignment.type == "IDENTIFIER": if assignment.type == "IDENTIFIER":
vardata = self._find_variable(var_container,assignment.name,assignment.line) vardata = self._find_variable(var_container,assignment.name,assignment.line)
if vardata["borrowed"]: if vardata["borrowed"] and (assignment.right is None):
borrowtype = self.TYPE_BORROWED borrowtype = self.TYPE_BORROWED
else: else:
borrowtype = self.TYPE_NO_BORROWED borrowtype = self.TYPE_NO_BORROWED
......
typedef __crust_t__ struct {
int element;
} *crust_t;
#define NULL ((void *)0)
void function(crust_t param) {
function(param); // a trick to free param and trigger only one error
}
void main(crust_t __crust_borrow__ param) {
int var2 = param->element;
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment