http://llvm.org/bugs/show_bug.cgi?id=18780

[email protected] changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |[email protected]
         Resolution|---                         |INVALID

--- Comment #2 from [email protected] ---
The lambda function that is assigned to a->on_run captures on_create's
parameter <a> by reference instead of by value, i.e. it accesses a position in
the stack which can and will be reused later on. To test this add a function
<bar> that uses some stack space:

void bar()
{
  int s[] = { 1, 2, 3, 4, 5 };
}

and then call it before on_run:

  a.a = 1;
  bar();
  a.on_run();

Capturing <a> by value should make your code work as expected (it does on my
computer). Otherwise please feel free to reopen this bug.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs

Reply via email to