def get_generator_state(self, builder, genptr, return_type):
        """
        From the given *genptr* (a pointer to a _dynfunc.Generator object),
        get a pointer to its state area.
        """
        return cgutils.pointer_add(
            builder,
            genptr,
            _dynfunc._impl_info["offsetof_generator_state"],
            return_type=return_type,
        )

        From the given *genptr* (a pointer to a _dynfunc.Generator object),
        get a pointer to its state area.
        
numba/tests/test_target_extension.py