Skip to content
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

closure not properly traced #375

Closed
albertnetymk opened this issue Apr 12, 2016 · 1 comment
Closed

closure not properly traced #375

albertnetymk opened this issue Apr 12, 2016 · 1 comment
Assignees

Comments

@albertnetymk
Copy link
Contributor

class Container<t> {
  def read() : int {
    0;
  }
}

class Main
  def main() : void{
    let bob = new Graph(10);
    bob.run();
  }

class Graph
  vat_array : [Container<int>]

  def init(size : int) : void {
    this.vat_array = new [Container<int>](size);
    for index in [0 .. |this.vat_array|-1]{
      this.vat_array[index] = new Container<int>();
    };
  }

  def run() : void {
    this ! updateEdge(1,0);
    for index in [2 .. |this.vat_array|-1]{
      let candidate = 1;
      (this.vat_array[candidate]).read() ~~> \(value : int) -> {
        this.vat_array[candidate];
      };
    };
  }

  def updateEdge(node : int, connection : int) : void {
    (this.vat_array[node]).read() ~~> \(x:int) -> { () };
  }

The memory for closures is corrupted; I see segfault within roughly 10 runs.

@EliasC
Copy link
Contributor

EliasC commented Apr 13, 2016

Fixed by #376

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants