update & bug fixed

This commit is contained in:
Valk Richard Li
2020-11-03 19:27:21 +08:00
parent 3868e986fb
commit a0728ad193
22 changed files with 5140 additions and 41 deletions
+11
View File
@@ -286,6 +286,8 @@ int nasal_hash::get_value_address(std::string key)
}
}
}
else
std::cout<<">> [runtime] cannot find hash member \""<<key<<"\".\n";
return ret_value_addr;
}
int nasal_hash::get_mem_address(std::string key)
@@ -311,6 +313,15 @@ int nasal_hash::get_mem_address(std::string key)
}
}
}
else
{
int mem_addr=nasal_vm.mem_alloc();
int val_addr=nasal_vm.gc_alloc();
nasal_vm.gc_get(val_addr).set_type(vm_nil);
nasal_vm.mem_init(mem_addr,val_addr);
elems[key]=mem_addr;
ret_mem_addr=mem_addr;
}
return ret_mem_addr;
}
bool nasal_hash::check_contain(std::string key)