NonNull template

Jonathan M Davis newsgroup.d at jmdavisprog.com
Sat Apr 19 22:49:19 UTC 2025


On Thursday, April 17, 2025 8:39:27 PM MDT Walter Bright via Digitalmars-d wrote:
> I'd like to know what those gdc and ldc transformations are, and whether they
> are controllable with a switch to their optimizers.
>
> I know there's a problem with WASM not faulting on a null dereference, but in
> another post I suggested a way to deal with it.

Unfortunately, my understanding isn't good enough to explain those details.
I discussed it with Johan in the past, but I've never worked on ldc or with
llvm (or on gdc/gcc), so I really don't know what is or isn't possible.
However, from what I recall of what Johan said, we were kind of stuck, and
llvm considered dereferencing null to be undefined behavior.

It may be the case that there's some sort of way to control that (and llvm
may have more capabilities in that regard since I last discussed it with
Johan), but someone who actually knows llvm is going to have to answer those
questions. And I don't know how gdc's situation differs either.

- Jonathan M Davis





More information about the Digitalmars-d mailing list