Original Post
I''ve been over this problem for hours and it simply breaks every rule of logic I throw at it. Here''s a simplified code sample, in orther words with all code before and after removed
.
class CSlawModel
{
private:
char *name;
public:
__inline const char *GetName()
{
return name;
}
};
class CSlawModel
{
public:
CSlawObject *Objects;
CSlawObject *GetObject()
{
return Objects;
}
};
void SomeFunc(CSlawModel *Model)
{
CSlawObject *Object1=Model->Objects;
CSlawObject *Object2=Model->GetObject();
/*at this point Object1=the correct hex address, checked by debugging where as Object2=0x100*/
const char *String=Object1->GetName();
/*this call fails and in debug mode when it steps into the function GetName the ''this'' pointer is set to 0x100*/
}
Can anyone tell me WTF is happening. I should say that the way I''ve represnted the code sample is the EXACT way the code is in my actual however since sending the actual code would require sending most of the engine I''m writing which is very big I figured I''d just send this.
From what I can tell my compiler is stuffing up, maybe it''s time to upgrade.