Fix ctrl-c in redbean on Windows

This commit is contained in:
Justine Tunney 2023-10-13 07:43:47 -07:00
parent d458642790
commit 4bcb107cb0
No known key found for this signature in database
GPG key ID: BE714B4575D6E328
12 changed files with 326 additions and 32 deletions

View file

@ -1059,15 +1059,12 @@ privileged size_t kvsnprintf(char *b, size_t n, const char *fmt, va_list v) {
privileged void kvprintf(const char *fmt, va_list v) {
#pragma GCC push_options
#pragma GCC diagnostic ignored "-Walloca-larger-than="
long size = 3000;
/* long size = __get_safe_size(8000, 3000); */
/* if (size < 80) { */
/* asm("int3"); */
/* klog(STACK_ERROR, sizeof(STACK_ERROR) - 1); */
/* return; */
/* } */
long size = __get_safe_size(8000, 3000);
if (size < 80) {
asm("int3");
klog(STACK_ERROR, sizeof(STACK_ERROR) - 1);
return;
}
char *buf = alloca(size);
CheckLargeStackAllocation(buf, size);
#pragma GCC pop_options