I assume that by writing *p = 8, you modified the value at the memory address where a is stored. This is why no errors occur — that’s the expected behavior when working with pointers.
*p = 8
a