From 7ab4630cc9e28d71d8dbad05bcb9cc3121c3a587 Mon Sep 17 00:00:00 2001 From: Justine Tunney Date: Sun, 8 Jan 2023 05:47:18 -0800 Subject: [PATCH] Fix MODE=asan build regression --- third_party/hiredis/hiredis.c | 3 ++- tool/emacs/cosmo-cpp-constants.el | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/third_party/hiredis/hiredis.c b/third_party/hiredis/hiredis.c index 85630b418..57b54d7cf 100644 --- a/third_party/hiredis/hiredis.c +++ b/third_party/hiredis/hiredis.c @@ -52,6 +52,7 @@ #include "third_party/musl/rand48.h" #include "libc/assert.h" #include "libc/errno.h" +#include "libc/mem/gc.h" #include "libc/str/str.h" #include "third_party/hiredis/hiredis.h" @@ -977,7 +978,7 @@ redisPushFn *redisSetPushCallback(redisContext *c, redisPushFn *fn) { * After this function is called, you may use redisGetReplyFromReader to * see if there is a reply available. */ int redisBufferRead(redisContext *c) { - char buf[1024*16]; + char *buf = _gc(malloc(1024*16)); int nread; /* Return early when the context has seen an error. */ diff --git a/tool/emacs/cosmo-cpp-constants.el b/tool/emacs/cosmo-cpp-constants.el index d4f19e975..d70168bcc 100644 --- a/tool/emacs/cosmo-cpp-constants.el +++ b/tool/emacs/cosmo-cpp-constants.el @@ -16,6 +16,7 @@ "__GNUC_PATCHLEVEL__" "__GNUC__" "__APPLE__" + "__CYGWIN__" "__EMSCRIPTEN__" "__ANDROID__" "__FreeBSD__"