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) {
callee_basic_blocks.push_back(&nodes[key]);
}
for (llvm::Argument const& arg: callee_func->args()) {
llvm::Value* value = call->getArgOperand(arg.getArgNo());
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;
AbstractState state_update{ callee_func, state_new, call };
changed = nodes[callee_element].state.merge(merge_op, state_update);
}
//Getting the last block
......
......@@ -30,10 +30,12 @@ NormalizedConjunction::NormalizedConjunction(llvm::Function const* callee_func,
if (value->getType()->isIntegerTy()) {
if (llvm::ConstantInt const* c = llvm::dyn_cast<llvm::ConstantInt>(value)) {
get(&arg) = { &arg, 1 , nullptr, c->getSExtValue() };
} else {
} else if (state.values.count(value) > 0) {
LinearEquality value_equality = state.values.at(value);
LinearEquality eq = { &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);
}
......
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