GP-2212 Mark calls with boolean return values

This commit is contained in:
caheckman 2022-06-21 15:59:12 -04:00
parent 47cda95669
commit 359ddc5c87
2 changed files with 4 additions and 0 deletions

View file

@ -1470,6 +1470,8 @@ void ActionFuncLink::funcLinkOutput(FuncCallSpecs *fc,Funcdata &data)
Datatype *outtype = outparam->getType(); Datatype *outtype = outparam->getType();
if (outtype->getMetatype() != TYPE_VOID) { if (outtype->getMetatype() != TYPE_VOID) {
int4 sz = outparam->getSize(); int4 sz = outparam->getSize();
if (sz == 1 && outtype->getMetatype() == TYPE_BOOL)
data.opMarkCalculatedBool(fc->getOp());
Address addr = outparam->getAddress(); Address addr = outparam->getAddress();
data.newVarnodeOut(sz,addr,fc->getOp()); data.newVarnodeOut(sz,addr,fc->getOp());
VarnodeData vdata; VarnodeData vdata;

View file

@ -4638,6 +4638,8 @@ void FuncCallSpecs::commitNewOutputs(Funcdata &data,Varnode *newout)
// We could conceivably truncate the output to the correct size to match the parameter // We could conceivably truncate the output to the correct size to match the parameter
activeoutput.registerTrial(param->getAddress(),param->getSize()); activeoutput.registerTrial(param->getAddress(),param->getSize());
PcodeOp *indop = newout->getDef(); PcodeOp *indop = newout->getDef();
if (newout->getSize() == 1 && param->getType()->getMetatype() == TYPE_BOOL)
data.opMarkCalculatedBool(op);
if (newout->getSize() == param->getSize()) { if (newout->getSize() == param->getSize()) {
if (indop != op) { if (indop != op) {
data.opUnsetOutput(indop); data.opUnsetOutput(indop);