mirror of
https://github.com/Ed94/Odin.git
synced 2026-06-22 13:44:59 -07:00
Add -obfuscate-source-code-locations
This commit is contained in:
+10
-1
@@ -1982,16 +1982,25 @@ gb_internal bool cg_switch_stmt_can_be_trivial_jump_table(AstSwitchStmt *ss) {
|
||||
if (ss->tag == nullptr) {
|
||||
return false;
|
||||
}
|
||||
enum { DISALLOW_64_SWITCH = true };
|
||||
|
||||
bool is_typeid = false;
|
||||
TypeAndValue tv = type_and_value_of_expr(ss->tag);
|
||||
if (is_type_integer(core_type(tv.type))) {
|
||||
if (type_size_of(tv.type) > 8) {
|
||||
i64 sz = type_size_of(tv.type);
|
||||
if (sz > 8) {
|
||||
return false;
|
||||
}
|
||||
if (DISALLOW_64_SWITCH && sz == 8) {
|
||||
return false;
|
||||
}
|
||||
// okay
|
||||
} else if (is_type_typeid(tv.type)) {
|
||||
// okay
|
||||
is_typeid = true;
|
||||
if (DISALLOW_64_SWITCH && build_context.ptr_size == 8) {
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user