aboutsummaryrefslogtreecommitdiff
path: root/src/checker.cpp
diff options
context:
space:
mode:
authorgingerBill <bill@gingerbill.org>2024-04-11 15:55:01 +0100
committergingerBill <bill@gingerbill.org>2024-04-11 15:55:01 +0100
commitb2e887be36a23dbfc52e50eb054ccceeeea31692 (patch)
treee5f0c4e2bd9c5e135c8288d92101f06c11662d65 /src/checker.cpp
parentf36fb6d1ef6ad1f4c5dc56b9b761e843195546b6 (diff)
Change stack overflow check to >256 KiB
Diffstat (limited to 'src/checker.cpp')
-rw-r--r--src/checker.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/checker.cpp b/src/checker.cpp
index 35554cf44..900a4f243 100644
--- a/src/checker.cpp
+++ b/src/checker.cpp
@@ -706,8 +706,8 @@ gb_internal void check_scope_usage(Checker *c, Scope *scope, u64 vet_flags) {
} else if (e->kind == Entity_Variable && (e->flags & (EntityFlag_Param|EntityFlag_Using)) == 0 && !e->Variable.is_global) {
i64 sz = type_size_of(e->type);
// TODO(bill): When is a good size warn?
- // Is 128 KiB good enough?
- if (sz >= 1ll<<17) {
+ // Is >256 KiB good enough?
+ if (sz > 1ll<<18) {
gbString type_str = type_to_string(e->type);
warning(e->token, "Declaration of '%.*s' may cause a stack overflow due to its type '%s' having a size of %lld bytes", LIT(e->token.string), type_str, cast(long long)sz);
gb_string_free(type_str);