aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorgingerBill <gingerBill@users.noreply.github.com>2025-11-28 13:10:23 +0000
committerGitHub <noreply@github.com>2025-11-28 13:10:23 +0000
commitdd20a587e8c083afa0e51e6d34b95d93a5acb7fd (patch)
tree63a66e408b4f2d1e3eb7f8d497d0bc5248688389 /src
parent03b1b551c48c256fdfbe07a2b56eb095e0c4531b (diff)
parentba9b9eacb500c0431baddf69d459f5314ebc3128 (diff)
Merge pull request #5973 from FrancisTheCat/master
Fix #5967 (Incorrect stack overflow warning for by ref switches over unions)
Diffstat (limited to 'src')
-rw-r--r--src/checker.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/checker.cpp b/src/checker.cpp
index 235d4def9..4d5482933 100644
--- a/src/checker.cpp
+++ b/src/checker.cpp
@@ -790,8 +790,10 @@ gb_internal void check_scope_usage_internal(Checker *c, Scope *scope, u64 vet_fl
// Is >256 KiB good enough?
if (sz > 1ll<<18) {
bool is_ref = false;
- if((e->flags & EntityFlag_ForValue) != 0) {
+ if ((e->flags & EntityFlag_ForValue) != 0) {
is_ref = type_deref(e->Variable.for_loop_parent_type) != NULL;
+ } else if ((e->flags & EntityFlag_SwitchValue) != 0) {
+ is_ref = !(e->flags & EntityFlag_Value);
}
if(!is_ref) {
gbString type_str = type_to_string(e->type);