|
-
June 10th, 2009, 10:48 AM
#1
Odd program flow occuring
I have an MFC DLL (old working Visual C++ 6.0 code) that is part of a much larger project (all converted from Visual Studio 6 to .NET 2005). I'm having trouble at one point (at least that I've noticed). The program seems to be flowing to sections in code that make no sense.
For example, it's in a large if/then/else block and within that is another if statement. It will test the inside if statement(shouldn't take the if block) then jump down to the big else block below the larger if statement its in. Then it jumps back to the end of that larger if block, then back to statement in else block again, then back up to the inside of the inside if statement it shouldn't have taken in the first place.
I neglect to put specific code, because I don't think code is the problem. Here is an example of the section of monitoring do this.
Code:
1 if (condition 1)
2 {
3 if (inside condition)
4 {
5 inside statement
6 }
7 }
8 else if (condition 2)
9 {
10 statement 1
11 }
If this represents the description above, then the flow goes like this:
1
3 (should NOT take block inside this if e.g. 5)
10
7
10
5 (inside block it should never have taken in first place)
OK....my first thought was some sort of stack corruption, but when I view disassembly during debug, it appears to have valid assembly code making these jumps happen.
So I'm guessing it may be some kind of project setting. Can you think of any project setting that could affect compilation in this way? Thanks for any help/ideas.
P.S. I can post code if necessary, but I didn't think it was probably relevant and would only complicate the issue.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|