diff --git a/examples/examples.mk b/examples/examples.mk index 006ce46f6..04e858620 100644 --- a/examples/examples.mk +++ b/examples/examples.mk @@ -131,10 +131,6 @@ o/$(MODE)/examples/nesemu1.com.dbg: \ $(APE) @$(APELINK) -o/$(MODE)/examples/loader.o: \ - OVERRIDE_CCFLAGS += \ - -fno-record-gcc-switches - o/$(MODE)/examples/loader.elf: \ o/$(MODE)/examples/loader.o \ examples/loader.lds diff --git a/examples/loader.c b/examples/loader.c index 382c89e51..1a9136165 100644 --- a/examples/loader.c +++ b/examples/loader.c @@ -43,7 +43,7 @@ asm(".globl\t_start\n\t" "mov\t%rsp,%rdi\n\t" "jmp\tloader"); -static noasan noubsan void spawn(long *sp, char *b) { +static noinstrument noasan noubsan void spawn(long *sp, char *b) { struct Elf64_Ehdr *e; struct Elf64_Phdr *h; e = (void *)b; @@ -61,7 +61,7 @@ static noasan noubsan void spawn(long *sp, char *b) { } } -noasan noubsan void loader(long *sp) { +noinstrument noasan noubsan void loader(long *sp) { struct stat st; int c, i, fd, argc; char *b, *p, *q, **argv; diff --git a/libc/calls/fstatat-sysv.c b/libc/calls/fstatat-sysv.c index dceac5c93..594ef7df5 100644 --- a/libc/calls/fstatat-sysv.c +++ b/libc/calls/fstatat-sysv.c @@ -33,7 +33,7 @@ int32_t sys_fstatat(int32_t dirfd, const char *path, struct stat *st, if (IsAsan() && !__asan_is_valid(path, 1)) return efault(); if (IsLinux()) { _Static_assert(sizeof(*st) == sizeof(ms.linux), "assumption broken"); - if (IsAsan() && !__asan_is_valid(st, sizeof(*st))) return efault(); + if (IsAsan() && (st && !__asan_is_valid(st, sizeof(*st)))) return efault(); p = st; } else if (st) { p = &ms; diff --git a/third_party/python/Objects/abstract.c b/third_party/python/Objects/abstract.c index 248297746..6a00635d8 100644 --- a/third_party/python/Objects/abstract.c +++ b/third_party/python/Objects/abstract.c @@ -2210,9 +2210,8 @@ PyObject_CallObject(PyObject *o, PyObject *a) return PyEval_CallObjectWithKeywords(o, a, NULL); } -#ifdef MODE_DBG PyObject* -_Py_CheckFunctionResult(PyObject *func, PyObject *result, const char *where) +(_Py_CheckFunctionResult)(PyObject *func, PyObject *result, const char *where) { int err_occurred = (PyErr_Occurred() != NULL); @@ -2258,7 +2257,6 @@ _Py_CheckFunctionResult(PyObject *func, PyObject *result, const char *where) } return result; } -#endif PyObject * PyObject_Call(PyObject *func, PyObject *args, PyObject *kwargs) diff --git a/third_party/sqlite3/shell.c b/third_party/sqlite3/shell.c index 6d5f4f185..e062d456a 100644 --- a/third_party/sqlite3/shell.c +++ b/third_party/sqlite3/shell.c @@ -90,6 +90,7 @@ #include "libc/stdio/stdio.h" #include "libc/str/str.h" #include "libc/calls/calls.h" +#include "libc/calls/struct/stat.macros.h" #include "third_party/sqlite3/sqlite3.h" typedef sqlite3_int64 i64;