Make read1 more reentrant
This is needed if ‘read’ is called soon after startup, before the Unicode tables have been set up, and it reads a \N escape and needs to look up a value the Unicode tables, a lookup that in turn calls read1 recursively. Although this change doesn’t make ‘read’ fully reentrant, it’s good enough to handle this case. * src/lread.c (read_buffer_size, read_buffer): Remove static vars. (grow_read_buffer): Revamp to use locals, not statics, and to record memory allocation un the specpdl. All callers changed. (read1): Start with a stack-based buffer, and use the heap only if the stack buffer is too small. Use unbind_to to free any heap buffer allocated. Use bool for boolean. Redo symbol loop so that only one call to grow_read_buffer is needed. (init_obarray): Remove no-longer-needed initialization.
Showing
Please register or sign in to comment