Commit 8a2dcdd0 authored by Kenton Varda's avatar Kenton Varda Committed by GitHub

Merge pull request #346 from dwrensha/asan

prevent use-after-free in internal compiler API
parents 49ce5c97 4d75033b
......@@ -320,12 +320,13 @@ private:
kj::Arena nodeArena;
// Arena used to allocate nodes and other permanent objects.
Workspace workspace;
// The temporary workspace.
std::unordered_map<Module*, kj::Own<CompiledModule>> modules;
// Map of parser modules to compiler modules.
Workspace workspace;
// The temporary workspace. This field must be declared after `modules` because objects
// allocated in the workspace may hold references to the compiled modules in `modules`.
std::unordered_map<uint64_t, Node*> nodesById;
// Map of nodes by ID.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment