To protect your data, the CISO officer has suggested users to enable GitLab 2FA as soon as possible.

Commit 4f903fd0 authored by Isaac Oscar Gariano's avatar Isaac Oscar Gariano
Browse files

Updated rodal and dump only whitlisted names

parent 1801580b
......@@ -37,8 +37,8 @@ gcc = "*"
mu_ast = {path = "src/ast"}
mu_utils = {path = "src/utils"}
#mu_gc = {path = "src/gc"}
rodal = { git = "https://gitlab.anu.edu.au/mu/rodal", version = ">= 0.0.10" }
#rodal = { path = "../rodal_test/rodal", version = ">= 0.0.5" }
rodal = { git = "https://gitlab.anu.edu.au/mu/rodal", version = "^0.1.13" }
#rodal = { path = "./rodal", version = "*" }
libc="*"
field-offset = "*"
......
......@@ -25,6 +25,6 @@ mu_utils = {path = "../utils"}
lazy_static = "*"
log = "*"
simple_logger = "*"
rodal = { git = "https://gitlab.anu.edu.au/mu/rodal", version = ">= 0.0.10" }
regex = "*"
#rodal = { path = "../../../rodal_test/rodal", version = ">= 0.0.5" }
rodal = { git = "https://gitlab.anu.edu.au/mu/rodal", version = "^0.1.13" }
#rodal = { path = "../../rodal", version = "*" }
......@@ -21,6 +21,7 @@ use rodal;
use utils::Address;
use std::sync::Arc;
use runtime::resolve_symbol;
use std;
use std::ops;
use std::collections::HashMap;
use std::collections::HashSet;
......@@ -53,9 +54,10 @@ pub struct CompiledFunction {
/// end location of this compiled function
pub end: ValueLocation
}
rodal_named!(CompiledFunction);
unsafe impl rodal::Dump for CompiledFunction {
fn dump<D: ?Sized + rodal::Dumper>(&self, dumper: &mut D) {
dumper.debug_record("CompiledFunction", "dump");
dumper.debug_record::<Self>("dump");
dumper.dump_object(&self.func_id);
dumper.dump_object(&self.func_ver_id);
dumper.dump_object(&self.temps);
......@@ -116,6 +118,7 @@ impl CompiledFunction {
}
// Contains information about a callsite (needed for exception handling)
rodal_named!(CompiledCallsite);
pub struct CompiledCallsite {
pub exceptional_destination: Option<Address>,
pub stack_args_size: usize,
......
......@@ -39,5 +39,5 @@ simple_logger = "*"
aligned_alloc = "*"
crossbeam = "*"
field-offset = "*"
rodal = { git = "https://gitlab.anu.edu.au/mu/rodal", version = ">= 0.0.10" }
#rodal = { path = "../../../rodal_test/rodal", version = ">= 0.0.5" }
rodal = { git = "https://gitlab.anu.edu.au/mu/rodal", version = "^0.1.13" }
#rodal = { path = "../../rodal", version = "*" }
......@@ -24,7 +24,7 @@ crate-type = ["rlib"]
memmap = "*"
memsec = "0.1.9"
byteorder = "*"
rodal = { git = "https://gitlab.anu.edu.au/mu/rodal", version = ">= 0.0.10" }
#rodal = { path = "../../../rodal_test/rodal", version = ">= 0.0.5" }
log = "*"
doubly = "1.1.3"
rodal = { git = "https://gitlab.anu.edu.au/mu/rodal", version = "^0.1.13" }
#rodal = { path = "../../rodal", version = "*" }
......@@ -128,20 +128,14 @@ pub struct VM {
pub pending_joins: Mutex<LinkedList<JoinHandle<()>>>
}
rodal_named!(VM);
unsafe impl rodal::Dump for VM {
fn dump<D: ?Sized + rodal::Dumper>(&self, dumper: &mut D) {
dumper.debug_record("VM", "dump");
dumper.debug_record::<Self>("dump");
dumper.dump_object(&self.next_id);
dumper.dump_padding(&self.id_name_map);
let id_name_map = RwLock::new(rodal::EmptyHashMap::<MuID, MuName>::new());
dumper.dump_object_here(&id_name_map);
dumper.dump_padding(&self.name_id_map);
let name_id_map = RwLock::new(rodal::EmptyHashMap::<MuName, MuID>::new());
dumper.dump_object_here(&name_id_map);
dumper.dump_object(&self.id_name_map);
dumper.dump_object(&self.name_id_map);
dumper.dump_object(&self.types);
dumper.dump_object(&self.ref_types);
dumper.dump_object(&self.backend_type_info);
......@@ -1118,6 +1112,26 @@ impl<'a> VM {
) {
info!("Making boot image...");
// Only store name info for whitelisted entities
{
let mut new_id_name_map = HashMap::<MuID, MuName>::with_capacity(whitelist.len());
let mut new_name_id_map = HashMap::<MuName, MuID>::with_capacity(whitelist.len());
let mut id_name_map = self.id_name_map.write().unwrap();
let mut name_id_map = self.name_id_map.write().unwrap();
for &id in whitelist.iter() {
match id_name_map.get(&id) {
Some(name) => {
new_id_name_map.insert(id, name.clone());
new_name_id_map.insert(name.clone(), id);
}
None => {}
}
}
*id_name_map = new_id_name_map;
*name_id_map = new_name_id_map;
}
// compile the whitelist functions
let whitelist_funcs = {
let compiler = Compiler::new(CompilerPolicy::default(), self);
......
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