Comment

Comment by lmm

> Doesn't null-pointer-dereference always crash the application?

No. It's undefined behaviour, it may do anything or nothing.

> Is it only an undefined-behavior because program-must-crash is not the explicitly required by these languages' specs?

I don't understand the question here. It's undefined behaviour because the spec says it's undefined behaviour, which is some combination of because treating it as impossible allows many optimisation opportunities and because of historical accidents.

parent lmm 11 months ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton