Define the behaviour of integer division by zero

This commit is contained in:
gingerBill
2025-08-08 10:00:11 +01:00
parent 3194fda8f3
commit e4a0228a80
4 changed files with 247 additions and 30 deletions
+7
View File
@@ -404,6 +404,11 @@ String linker_choices[Linker_COUNT] = {
str_lit("radlink"),
};
enum IntegerDivisionByZeroKind : u8 {
IntegerDivisionByZero_Trap,
IntegerDivisionByZero_Zero,
};
// This stores the information for the specify architecture of this build
struct BuildContext {
// Constants
@@ -485,6 +490,8 @@ struct BuildContext {
bool keep_object_files;
bool disallow_do;
IntegerDivisionByZeroKind integer_division_by_zero_behaviour;
LinkerChoice linker_choice;
StringSet custom_attributes;