Verified Commit dd04bff6 authored by Tim Gymnich's avatar Tim Gymnich
Browse files

fixed handling of call inst

parent ad88b41b
...@@ -266,21 +266,8 @@ void executeFixpointAlgorithm(Module const& M) { ...@@ -266,21 +266,8 @@ void executeFixpointAlgorithm(Module const& M) {
callee_basic_blocks.push_back(&nodes[key]); callee_basic_blocks.push_back(&nodes[key]);
} }
for (llvm::Argument const& arg: callee_func->args()) { AbstractState state_update{ callee_func, state_new, call };
llvm::Value* value = call->getArgOperand(arg.getArgNo()); changed = nodes[callee_element].state.merge(merge_op, state_update);
if (value->getType()->isIntegerTy()) {
if (llvm::ConstantInt const* c = llvm::dyn_cast<llvm::ConstantInt>(value)) {
nodes[callee_element].state[&arg] = { &arg, 1 , nullptr, c->getSExtValue() };
} else {
LinearEquality value_equality = state_new[value];
LinearEquality eq = { &arg, value_equality.a , value_equality.x, value_equality.b };
nodes[callee_element].state[&arg] = { &arg, value_equality.a , value_equality.x, value_equality.b };
}
}
}
nodes[callee_element].state.isBottom = false;
//FIXME: somethingn is wrong here! This doesnt allways change ! check changed!!!
changed = before.values != nodes[callee_element].state.values;
} }
//Getting the last block //Getting the last block
......
...@@ -30,10 +30,12 @@ NormalizedConjunction::NormalizedConjunction(llvm::Function const* callee_func, ...@@ -30,10 +30,12 @@ NormalizedConjunction::NormalizedConjunction(llvm::Function const* callee_func,
if (value->getType()->isIntegerTy()) { if (value->getType()->isIntegerTy()) {
if (llvm::ConstantInt const* c = llvm::dyn_cast<llvm::ConstantInt>(value)) { if (llvm::ConstantInt const* c = llvm::dyn_cast<llvm::ConstantInt>(value)) {
get(&arg) = { &arg, 1 , nullptr, c->getSExtValue() }; get(&arg) = { &arg, 1 , nullptr, c->getSExtValue() };
} else { } else if (state.values.count(value) > 0) {
LinearEquality value_equality = state.values.at(value); LinearEquality value_equality = state.values.at(value);
LinearEquality eq = { &arg, value_equality.a , value_equality.x, value_equality.b }; LinearEquality eq = { &arg, value_equality.a , value_equality.x, value_equality.b };
get(&arg) = { &arg, value_equality.a , value_equality.x, value_equality.b }; get(&arg) = { &arg, value_equality.a , value_equality.x, value_equality.b };
} else {
get(&arg) = { &arg, 1 , value, 0 };
} }
validVariables.insert(&arg); validVariables.insert(&arg);
} }
......
Supports Markdown
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