(self, ty, perspective_returned=False)
return self.RETURN_VAL.refine(size=ty.size // self.arch.byte_width, arch=self.arch, is_fp=False)
The location the return value is stored, based on its type.
The location the return value is stored, based on its type.
The location the return value is stored based on its type .
def return_val(self, ty, perspective_returned=False):
        """
        The location the return value is stored, based on its type.
        """
        if ty._arch is None:
            ty = ty.with_arch(self.arch)
        if isinstance(ty, (SimStruct, SimUnion, SimTypeFixedSizeArray)):
            raise TypeError(f"{self} doesn't know how to return aggregate types. Consider overriding return_val to "
                            "implement its ABI logic")
        if self.return_in_implicit_outparam(ty):
            if perspective_returned:
                ptr_loc = self.RETURN_VAL
            else:
                ptr_loc = self.next_arg(self.ArgSession(self), SimTypePointer(SimTypeBottom()))
            return SimReferenceArgument(ptr_loc, SimStackArg(0, ty.size // self.arch.byte_width, is_fp=isinstance(ty, SimTypeFloat)))

        if isinstance(ty, SimTypeFloat):
            return self.FP_RETURN_VAL.refine(size=ty.size // self.arch.byte_width, arch=self.arch, is_fp=True)

        if ty.size > self.RETURN_VAL.size * self.arch.byte_width:
            return SimComboArg([self.RETURN_VAL, self.OVERFLOW_RETURN_VAL])
        return self.RETURN_VAL.refine(size=ty.size // self.arch.byte_width, arch=self.arch, is_fp=False)
def return_val ( self , ty , perspective_returned = False ) : if ty . _arch is None : ty = ty . with_arch ( self . arch ) if isinstance ( ty , ( SimStruct , SimUnion , SimTypeFixedSizeArray ) ) : raise TypeError ( f"{self} doesn't know how to return aggregate types. Consider overriding return_val to " "implement its ABI logic" ) if self . return_in_implicit_outparam ( ty ) : if perspective_returned : ptr_loc = self . RETURN_VAL else : ptr_loc = self . next_arg ( self . ArgSession ( self ) , SimTypePointer ( SimTypeBottom ( ) ) ) return SimReferenceArgument ( ptr_loc , SimStackArg ( 0 , ty . size // self . arch . byte_width , is_fp = isinstance ( ty , SimTypeFloat ) ) ) if isinstance ( ty , SimTypeFloat ) : return self . FP_RETURN_VAL . refine ( size = ty . size // self . arch . byte_width , arch = self . arch , is_fp = True ) if ty . size > self . RETURN_VAL . size * self . arch . byte_width : return SimComboArg ( [ self . RETURN_VAL , self . OVERFLOW_RETURN_VAL ] ) return self . RETURN_VAL . refine ( size = ty . size // self . arch . byte_width , arch = self . arch , is_fp = False )