Vesa Jääskeläinen <address@hidden> wrote:
Thank you for this information. This indeed seems to cure the
problem in this case. But shouldn't this be default for AVR ?
I'm not sure. On the AVR, memory address 0 is an alias for r0. Thus,
by dereferencing a NULL pointer, you're touching whatever r0 (rather
r0/r1) points to. As this can touch anywhere (including memory-mapped
IO devices), the behaviour is completely undefined, and you should
probably avoid that kind of program anyway.
However, the assumption that a pointer is not NULL just because the
program still runs at a certain point is for sure wrong for the AVR,
so I think you should write a bug report for this.