aboutsummaryrefslogtreecommitdiff
path: root/src/tilde_stmt.cpp
diff options
context:
space:
mode:
authorgingerBill <bill@gingerbill.org>2023-12-13 16:47:34 +0000
committergingerBill <bill@gingerbill.org>2023-12-13 16:47:34 +0000
commitca2b2c498e446895412bf297de0770a0bab839f7 (patch)
tree6314183a05c1a9b8182683ef8eb62ac3c9afbb61 /src/tilde_stmt.cpp
parent6e9e469abd0ec13c624df57d22ef30641fab7491 (diff)
Add `-obfuscate-source-code-locations`
Diffstat (limited to 'src/tilde_stmt.cpp')
-rw-r--r--src/tilde_stmt.cpp11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/tilde_stmt.cpp b/src/tilde_stmt.cpp
index 7c090064c..597a4262c 100644
--- a/src/tilde_stmt.cpp
+++ b/src/tilde_stmt.cpp
@@ -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;
}