The term "Undefined Behavior" (commonly shortened to "UB") refers to any behavior that cannot be defined by the language. This could be because the behavior would differ depending on the platform, or because the compiler assumes that the behavior never happens and generates instructions accordingly. Anything that is undefined behavior is explicitly disallowed by the Panther language specification and should be avoided.
The Panther compiler attempts to detect undefined behavior at compile time. In addition, there are build settings that can be enabled that check for undefined behavior at runtime (both for debug and release builds). It is impossible to detect all undefined behavior however, so these detection mechanisms do not guarantee that no undefined behavior exists in the Panther code.
1 2 3 4 5 6 7 8 9 10 11 12 13func entry = () #entry -> UI8 { const foo: UI8 = 12; // This is undefined behavior as addition is not allowed to overflow const sum_1: UI8 = foo + 255; // This is not undefined behavior as wrapping addition is allowed to overflow const sum_2: UI8 = foo +% 255; return 0; }