def guard_memory_error(context, builder, pointer, msg=None):
 assert isinstance(pointer.type, ir.PointerType), pointer.type
 exc_args = ((msg,) if msg else ())
 with builder.if_then(is_null(builder, pointer), likely=False):
  context.call_conv.return_user_exc(builder, MemoryError, exc_args)

def guard_memory_error ( context , builder , pointer , msg = None ) : assert isinstance ( pointer . type , ir . PointerType ) , pointer . type exc_args = ( ( msg , ) if msg else ( ) ) with builder . if_then ( is_null ( builder , pointer ) , likely = False ) : context . call_conv . return_user_exc ( builder , MemoryError , exc_args )
guard against *pointer* being null .