Search

miscompilation of aggregate initializer with lambdas inside by Lars Viklund

Closed
as Fixed Help for as Fixed

3
0
Sign in
to vote
Type: Bug
ID: 684953
Opened: 8/21/2011 10:40:07 AM
Access Restriction: Public
Moderator Decision: Sent to Engineering Team for consideration
1
Workaround(s)
2
User(s) can reproduce this bug
In the attached test case, if the second lambda in the aggregate initializer has a local variable with a constructor, invoking the first function<> will call the second and then invoke UB (stack smash or uninitialized data access).
Details (expand)

Visual Studio/Team Foundation Server/.NET Framework Tooling version

Visual Studio 2010 SP1

Steps to reproduce

Compile the attached source file.
Run the program.

Product Language

English

Operating System

Windows 7

Operating System Language

English

Actual results

The body of the second lambda 'b' is executed, prints "b" and crashes.

Expected results

The body of the first lambda should be executed.
File Attachments
File Name Submitted By Submitted On File Size  
lambda-lv-repro.cpp 8/21/2011 267 bytes
Sign in to post a comment.
Posted by Steve Wolf on 11/9/2011 at 8:40 AM
See discussion at:
http://stackoverflow.com/questions/8057765/work-around-for-vs2010-bug-in-table-of-lambdas/8058198#comment9874765_8058198
Posted by Microsoft on 9/13/2011 at 12:03 PM
Hi: this issue has been fixed. The fix should show up in a future release of Visual C++.

Thank you for reporting the issue.

Jonathan Caves
Visual C++ Compiler Team
Posted by MS-Moderator07 [Feedback Moderator] on 8/21/2011 at 7:11 PM
Thanks for your feedback.

We are rerouting this issue to the appropriate group within the Visual Studio Product Team for triage and resolution. These specialized experts will follow-up with your issue.
Posted by MS-Moderator01 on 8/21/2011 at 11:39 AM
Thank you for your feedback, we are currently reviewing the issue you have submitted. If this issue is urgent, please contact support directly(http://support.microsoft.com)
Sign in to post a workaround.
Posted by Steve Wolf on 11/9/2011 at 8:40 AM
See discussion & solution at:
http://stackoverflow.com/questions/8057765/work-around-for-vs2010-bug-in-table-of-lambdas/8058198#comment9874765_8058198