Browse Source

Change stack overflow check to >256 KiB

gingerBill 1 year ago
parent
commit
b2e887be36
1 changed files with 2 additions and 2 deletions
  1. 2 2
      src/checker.cpp

+ 2 - 2
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) {
 		} else if (e->kind == Entity_Variable && (e->flags & (EntityFlag_Param|EntityFlag_Using)) == 0 && !e->Variable.is_global) {
 			i64 sz = type_size_of(e->type);
 			i64 sz = type_size_of(e->type);
 			// TODO(bill): When is a good size warn?
 			// 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);
 				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);
 				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);
 				gb_string_free(type_str);