Hacker News
new
past
comments
ask
show
jobs
points
by
saagarjha
1 hours ago
|
comments
by
aw1621107
1 hours ago
|
[-]
> The problem is the code unconditionally dereferences the pointer, which would be UB if it was a null pointer.
Only when NDEBUG is defined, right?
reply
by
saagarjha
1 hours ago
|
parent
|
[-]
No, the code that does this is always active
reply
by
gottheUIblues
1 hours ago
|
parent
|
[-]
Right so strictly speaking C++ could do anything here when passed a null pointer, because even though assert terminates the program, the C++ compiler cannot see that, and there is then undefined behaviour in that case
reply