Call a native function after properly staging its arguments and return address. Args: addr: function entry point args: a sequence of 2-tuples containing parameters types and values to pass to the function; may be empty ret: return address; may be None
(self, addr: int, args: Sequence[Tuple[Any, int]], ret: Optional[int])
| 190 | return targs, retval, retaddr |
| 191 | |
| 192 | def call_native(self, addr: int, args: Sequence[Tuple[Any, int]], ret: Optional[int]) -> None: |
| 193 | """Call a native function after properly staging its arguments and return address. |
| 194 | |
| 195 | Args: |
| 196 | addr: function entry point |
| 197 | args: a sequence of 2-tuples containing parameters types and values to pass to the function; may be empty |
| 198 | ret: return address; may be None |
| 199 | """ |
| 200 | |
| 201 | # reserve slots for arguments |
| 202 | nslots = self.__count_slots(atype for atype, _ in args) |
| 203 | self.cc.reserve(nslots) |
| 204 | |
| 205 | if ret is not None: |
| 206 | self.cc.setReturnAddress(ret) |
| 207 | |
| 208 | # set arguments values |
| 209 | self.writeParams(args) |
| 210 | |
| 211 | # call |
| 212 | self.ql.arch.regs.arch_pc = addr |
no test coverage detected