Branch: Tag:

2019-11-14

2019-11-14 09:46:57 by Henrik Grubbström (Grubba) <grubba@grubba.org>

Compiler: Move node_allocator to struct compilation.

Allocated nodes may need to live during an entire translation unit.

This moves the allocator from struct Pike_compiler (ie compilation.h)
to struct compilation (aka CompilationEnvironment.PikeCompiler).

Fixes use of already freed nodes after certain syntax errors.

83:       struct program *p; /* Compiled program or NULL. */    struct lex lex; +  struct block_allocator node_allocator;/* Allocator for parse tree nodes. */       struct svalue default_module; /* predef:: */ -  struct byte_buffer used_modules; /* Stack of svalues with imported +  struct byte_buffer used_modules; /* Stack of svalues with imported    * modules. */    INT32 num_used_modules; /* Number of entries on the stack. */