mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-07-14 15:09:09 +00:00
Add error checks to Python objectifier (#281)
PYOBJ.COM was failing when statically analyzing _pyio.py in MODE=dbg because co_consts contained a big number, which dirtied the interpreter exception state. We now do comprehensive error checking w/ Python API. The -DSTACK_FRAME_UNLIMITED CPPFLAG has been removed from DES since its self test function has been fixed to use heap memory rather than making aggressive use of the stack. This change also fixes a regression with function tracing (the --ftrace flag a.k.a. ftrace_install() a.k.a. cosmo.ftrace) in ASAN build modes. Lastly, the _tracemalloc module should now always be available for use in MODE=dbg.
This commit is contained in:
parent
57f0eed382
commit
9cb54218ab
10 changed files with 323 additions and 422 deletions
2
third_party/python/Objects/obmalloc.c
vendored
2
third_party/python/Objects/obmalloc.c
vendored
|
@ -85,7 +85,7 @@ static void* _PyObject_Calloc(void *ctx, size_t nelem, size_t elsize);
|
|||
static void _PyObject_Free(void *ctx, void *p);
|
||||
static void* _PyObject_Realloc(void *ctx, void *ptr, size_t size);
|
||||
|
||||
#else
|
||||
#else
|
||||
/* in MODE=asan, no pymalloc, so use macro */
|
||||
#define _PyObject_Malloc(ctx, size) _PyMem_RawMalloc((ctx), (size))
|
||||
#define _PyObject_Calloc(ctx, nelem, elsize) _PyMem_RawCalloc((ctx), (nelem), (elsize))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue