This and all the other code assumes that the context was properly initialized. However, there is no guarantee that the `__construct` method was called, so `hash->ops`, `hash->context` etc could all be NULL here. I suggest throwing an exception in such a case.