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

Stefanos Baziotis sdi1600105 at di.uoa.gr
Sun Apr 28 19:06:29 UTC 2019


On Sunday, 28 April 2019 at 18:48:55 UTC, Adam D. Ruppe wrote:
>
> 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?

I fixed it, there was a bug, but not related to stack. Not 
related to memory at all.
As I was trying to fix the bug, the code changed unfortunately 
and now I try to reproduce the bug but I can't. I use visual D 
and one interesting point is that one file of the project was not 
added, but the compiler didn't yield an error although it tried 
to use its functions (but actually couldn't, I don't know how 
that can happen too. Using dmd from terminal, that never 
happens). I think that by adding the file, the changing of 
pointer value disappeared, but it could also be that in the 
process, I fixed a memory bug that I didn't notice (although that 
is quite unlikely). If I can reproduce it, I'll post it.

Thanks anyway,
- Stefanos



More information about the Digitalmars-d-learn mailing list