The following clip of code, found in FunctionProfilePolicy.hpp assigns the value of the exprpolicy (referred to as var below) instead of unioning it. It should instead union with def and use for the local map (referred to as it->second).
else if (ctx.IsOpen(ParserState::exprstmt) && ctx.IsClosed(ParserState::declstmt)){
exprData = *policy->Data<ExprPolicy::ExprDataSet>();
for(auto var : exprData.dataset){
auto it = profileset.dataset.find(var.first);
if(it != profileset.dataset.end()){
it->second.def = var.second.def;
it->second.use = var.second.use;
}else{
std::cerr<<"couldn't find identifier named: "<<var.first<<std::endl;
}
}
//data = exprData;
}
The following clip of code, found in FunctionProfilePolicy.hpp assigns the value of the exprpolicy (referred to as var below) instead of unioning it. It should instead union with def and use for the local map (referred to as it->second).