Home Dashboard Directory Help
Search

Vs2010 x64 C and C++ program crashes when string literal are not modified by Vipin Jain


Status: 

Closed
 as Fixed Help for as Fixed


7
0
Sign in
to vote
Type: Bug
ID: 577724
Opened: 7/23/2010 7:40:10 AM
Access Restriction: Public
1
Workaround(s)
view
2
User(s) can reproduce this bug

Description

Program is crashing even though it does not modify the string literal when compiled with VS2010 native x64 compiler with /O2 option.
Details
Sign in to post a comment.
Posted by Microsoft on 8/17/2010 at 5:41 PM
Hello. Thank you for your bug report. This is, indeed, an error in the generated code. This error will be fixed in a future release. In the meantime, please use the workaround suggested by jain_vipin_swim - passing a variable instead of a literal string should avoid the problem area.

Thank you.

Mark Levine
Dev Lead - Visual C++
Posted by Microsoft on 7/26/2010 at 1:44 AM
Thank you for reporting the issue.
We are routing 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 Microsoft on 7/24/2010 at 7:07 PM
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)
Posted by ildjarn on 7/23/2010 at 8:01 AM
Verified in VC++ 2010 x64. Analysis of this issue has been discussed on the Visual C++ forums; see http://social.msdn.microsoft.com/Forums/en-US/vcgeneral/thread/0a200af3-98c8-4d06-b32b-804a6272070a
Sign in to post a workaround.
Posted by Vipin Jain on 7/23/2010 at 7:43 AM
Problem can be work-around by using following piece of code:

func(char *p ) {
int i;
for ( i =0 ; i<strlen(p); i++ )
         if ( p[i] == '/' )
             p[i] = '\\';
}
int main(void) {
char p[100];
strcpy(p,"string_literal");
func(p);
}
File Name Submitted By Submitted On File Size  
newbottombanner.jpg (restricted) 8/18/2010 -