Skip to content

Commit

Permalink
Use encoded type for constant value mappings (#388)
Browse files Browse the repository at this point in the history
  • Loading branch information
tetsuo-cpp authored Aug 16, 2023
1 parent f7f498d commit 66bb39d
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions lib/Protobuf.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -638,11 +638,16 @@ void ProtobufTranslator::ParseCFGIntoFunction(
LOG(FATAL) << "No stack ptr";
}

auto stackptr_type_spec = SizeToType(stackptr->size * 8);
auto target_type_spec = DecodeType(symval.target_value().type());
if (!target_type_spec.Succeeded()) {
LOG(ERROR) << "Failed to lift target type "
<< target_type_spec.TakeError();
return;
}

auto target_vdecl =
DecodeValueDecl(symval.target_value().values(), stackptr_type_spec,
"Unable to get value decl for stack offset relation");
auto target_vdecl = DecodeValueDecl(
symval.target_value().values(), target_type_spec.TakeValue(),
"Unable to get value decl for target");

if (!target_vdecl.Succeeded()) {
LOG(ERROR) << "Failed to lift value " << target_vdecl.TakeError();
Expand Down

0 comments on commit 66bb39d

Please sign in to comment.