(
self,
target: Union[T, "BasePointer[T]"],
*,
unsafe: bool = False,
)
| 36 | |
| 37 | @handle |
| 38 | def move( |
| 39 | self, |
| 40 | target: Union[T, "BasePointer[T]"], |
| 41 | *, |
| 42 | unsafe: bool = False, |
| 43 | ) -> None: |
| 44 | if unsafe: |
| 45 | warnings.warn("unsafe has no effect on variable pointers") |
| 46 | |
| 47 | if not self.name: |
| 48 | raise NullPointerError("pointer is NULL") |
| 49 | |
| 50 | scope = self._get_scope() |
| 51 | |
| 52 | if (scope is self._frame.f_locals) and ( |
| 53 | self._frame.f_locals is not self._frame.f_globals |
| 54 | ): |
| 55 | force_update_locals( |
| 56 | self._frame, |
| 57 | self.name, |
| 58 | ( |
| 59 | ~target |
| 60 | if isinstance( |
| 61 | target, |
| 62 | BasePointer, |
| 63 | ) |
| 64 | else target |
| 65 | ), |
| 66 | ) |
| 67 | else: |
| 68 | scope[self.name] = ( |
| 69 | ~target |
| 70 | if isinstance( |
| 71 | target, |
| 72 | BasePointer, |
| 73 | ) |
| 74 | else target |
| 75 | ) |
| 76 | |
| 77 | @property |
| 78 | def address(self) -> Optional[int]: |
nothing calls this directly
no test coverage detected