Click here to Skip to main content
15,888,610 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Bug in Visual Studio 2005 compiler? Pin
Stefan_Lang20-Jan-14 1:21
Stefan_Lang20-Jan-14 1:21 
GeneralRe: Bug in Visual Studio 2005 compiler? Pin
a_matseevsky20-Jan-14 2:06
a_matseevsky20-Jan-14 2:06 
GeneralRe: Bug in Visual Studio 2005 compiler? Pin
Stefan_Lang20-Jan-14 3:46
Stefan_Lang20-Jan-14 3:46 
GeneralRe: Bug in Visual Studio 2005 compiler? Pin
a_matseevsky20-Jan-14 12:30
a_matseevsky20-Jan-14 12:30 
GeneralRe: Bug in Visual Studio 2005 compiler? Pin
a_matseevsky20-Jan-14 1:27
a_matseevsky20-Jan-14 1:27 
Well, I've just answered, but I do not see it... Well, let's go point by point

Stefan_Lang wrote:
You should really look at the problem again and consider some or all of the following questions:

1. Where did you get the information that
- _lrct$ refers to the start address of the RECT struct you're referring to

What do you think .asm files exist for? Compiler made them and I was able to see, where local and temporary variables was allocated.

- the RECT struct is really 16 bytes in size
Nice question, it comes to my mind too- but the same compiler was so kind, that showed me the size of a RECT structure

- the offsets you show are in fact relative to the same base address
You should know, that ebp register remains constant within any procedure! And in this particular case all local and temporary variables was addressed via ebp.

2. Did you derive from your observation of these addresses that part of your data is overwritten, or did you check the actual RECT structure to verify that?

I saw it, running my prog under debugger and I know which command (fst) overwrote aforementioned RECT (in fact, only right and bottom).


3. What are the original declarations of the C/C++ symbols corresponding to the two addresses _lrct$ and tv5476?

RECT lrct; the second variable is local storage, using to temporary storage of ST(0)

4. How were the two objects allocated?

I wrote it, but I can repeat it again. _lrct=-212 and tv5476=-204 (number a decimal ones!) It means, that command fst tv5476[ebp] overwrites 8 bytes- one half of lrct structure.

5. Are you sure that one of them (the RECT) hasn't been deallocated in the meantime? Note that optimizers may discard variables before the end of their lifetime as seen in code if they realize it is no longer used!

It would be possible, but in such case debugger refuses to show such variable and gives message like "expression cannot be evaluated". Moreover, compiler wouldn't let me to use a variable outside of the block, where it was declared.

I'm sure I could think of more questions, but this could be much more productive if we could see the actual code ...

You saw it. Answer a question, originally addressed to Richard- which variant (and why) refuses to work properly.
GeneralRe: Bug in Visual Studio 2005 compiler? Pin
Stefan_Lang20-Jan-14 1:59
Stefan_Lang20-Jan-14 1:59 
GeneralRe: Bug in Visual Studio 2005 compiler? Pin
a_matseevsky20-Jan-14 2:42
a_matseevsky20-Jan-14 2:42 
GeneralRe: Bug in Visual Studio 2005 compiler? Pin
Stefan_Lang20-Jan-14 3:33
Stefan_Lang20-Jan-14 3:33 
GeneralRe: Bug in Visual Studio 2005 compiler? Pin
a_matseevsky20-Jan-14 12:46
a_matseevsky20-Jan-14 12:46 
AnswerRe: Bug in Visual Studio 2005 compiler? Pin
jschell17-Jan-14 13:16
jschell17-Jan-14 13:16 
GeneralRe: Bug in Visual Studio 2005 compiler? Pin
a_matseevsky17-Jan-14 14:33
a_matseevsky17-Jan-14 14:33 
GeneralRe: Bug in Visual Studio 2005 compiler? Pin
Richard MacCutchan17-Jan-14 22:24
mveRichard MacCutchan17-Jan-14 22:24 
GeneralRe: Bug in Visual Studio 2005 compiler? Pin
a_matseevsky18-Jan-14 0:46
a_matseevsky18-Jan-14 0:46 
GeneralRe: Bug in Visual Studio 2005 compiler? Pin
Richard MacCutchan18-Jan-14 1:13
mveRichard MacCutchan18-Jan-14 1:13 
GeneralRe: Bug in Visual Studio 2005 compiler? Pin
a_matseevsky18-Jan-14 10:01
a_matseevsky18-Jan-14 10:01 
GeneralRe: Bug in Visual Studio 2005 compiler? Pin
Richard MacCutchan18-Jan-14 22:13
mveRichard MacCutchan18-Jan-14 22:13 
GeneralRe: Bug in Visual Studio 2005 compiler? Pin
a_matseevsky19-Jan-14 1:07
a_matseevsky19-Jan-14 1:07 
GeneralRe: Bug in Visual Studio 2005 compiler? Pin
Richard MacCutchan19-Jan-14 1:08
mveRichard MacCutchan19-Jan-14 1:08 
GeneralRe: Bug in Visual Studio 2005 compiler? Pin
a_matseevsky19-Jan-14 10:54
a_matseevsky19-Jan-14 10:54 
GeneralRe: Bug in Visual Studio 2005 compiler? Pin
pkfox19-Jan-14 20:20
professionalpkfox19-Jan-14 20:20 
GeneralRe: Bug in Visual Studio 2005 compiler? Pin
Richard MacCutchan19-Jan-14 22:21
mveRichard MacCutchan19-Jan-14 22:21 
GeneralRe: Bug in Visual Studio 2005 compiler? Pin
jschell18-Jan-14 11:51
jschell18-Jan-14 11:51 
GeneralRe: Bug in Visual Studio 2005 compiler? Pin
a_matseevsky18-Jan-14 17:42
a_matseevsky18-Jan-14 17:42 
GeneralRe: Bug in Visual Studio 2005 compiler? Pin
jschell20-Jan-14 12:45
jschell20-Jan-14 12:45 
GeneralRe: Bug in Visual Studio 2005 compiler? Pin
a_matseevsky20-Jan-14 12:54
a_matseevsky20-Jan-14 12:54 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.