Passing a pointer to a function (by value) changes the pointer value

Adam D. Ruppe destructionator at gmail.com
Sun Apr 28 18:48:55 UTC 2019


On Sunday, 28 April 2019 at 18:16:24 UTC, Stefanos Baziotis wrote:
> In the debugger, before calling 'foo', 't' had a value (an 
> address) let's say 10. Stepping
> into 'foo', the 't' that 'foo' got, which is supposed to have 
> the same value that the 't' in 'bar' had, actually had a 
> completely different value. That caused a very bad bug...

Sounds like you have a stack corruption bug somewhere else... 
memory being overwritten by something else.

Can you post any more of the context code?


More information about the Digitalmars-d-learn mailing list