Skip to content

Commit

Permalink
[hxb] do not use same m_extra reference
Browse files Browse the repository at this point in the history
Closes #11491
  • Loading branch information
kLabz committed Feb 22, 2024
1 parent 8593fb7 commit fe211b8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/compiler/server.ml
Original file line number Diff line number Diff line change
Expand Up @@ -399,7 +399,9 @@ class hxb_reader_api_server
m_path = path;
m_types = [];
m_statics = None;
m_extra = mc.mc_extra
(* Creating a new m_extra because if we keep the same reference, display requests *)
(* can alter it with bad data (for example adding dependencies that are not cached) *)
m_extra = { mc.mc_extra with m_deps = mc.mc_extra.m_deps }
}

method add_module (m : module_def) =
Expand Down
4 changes: 3 additions & 1 deletion src/context/display/displayJson.ml
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,9 @@ class hxb_reader_api_com
m_path = path;
m_types = [];
m_statics = None;
m_extra = mc.mc_extra
(* Creating a new m_extra because if we keep the same reference, display requests *)
(* can alter it with bad data (for example adding dependencies that are not cached) *)
m_extra = { mc.mc_extra with m_deps = mc.mc_extra.m_deps }
}

method add_module (m : module_def) =
Expand Down

0 comments on commit fe211b8

Please sign in to comment.