dmd.safe

Checks whether member access or array casting is allowed in @safe code.

Specification: Function Safety

Members

Functions

checkUnsafeAccess
bool checkUnsafeAccess(Scope* sc, Expression e, bool readonly, bool printmsg)

Check for unsafe access in @safe code: 1. read overlapped pointers 2. write misaligned pointers 3. write overlapped storage classes Print error if unsafe.

isSafeCast
bool isSafeCast(Expression e, Type tfrom, Type tto)

Determine if it is @safe to cast e from tfrom to tto.

Meta