4 Commits

Author SHA1 Message Date
Timm Baeder
fed6db45df
[clang][bytecode] Diagnose dereferencing a null pointer (#149330) 2025-07-19 21:39:06 +02:00
Corentin Jabot
c43f828d59
[Clang] Be less strict about diagnosing null pointer dereference. (#149648)
In #143667, we made constant evaluation fail on `*null_ptr`, as this is
UB. However, `&(*(foo*)0)` seems to be a common pattern, which made
#143667 too disruptive.

So instead of failing the evaluation, we note the UB, which let clang
recovers when checking for constant initialization.

Fixes #149500
2025-07-19 19:30:16 +02:00
Corentin Jabot
9e5470e7d6
[Clang] Diagnose forming references to nullptr (#143667)
Per [decl.ref],

> Because a null pointer value or a pointer past the end of an object
does not point to an object, a reference in a well-defined program
cannot refer to such things.

Note this does not fixes the new bytecode interpreter.

Fixes #48665
2025-07-16 14:25:24 +02:00
Timm Baeder
a07aba5d44
[clang] Rename all AST/Interp stuff to AST/ByteCode (#104552)
"Interp" clashes with the clang interpreter and people often confuse
this.
2024-08-16 17:13:12 +02:00