are
        // allowed to throw exceptions. note, that it is perfectly
        // fine to get null passed into the exception argument

        SimpleFinalizer(ref result);
        ex = EditFinalizer(ex, ref result);
        finalized = true;

        if (ex is not null) throw ex;
        return result;
    }
    catch (Exception e)
    {
        ex = e;

        // finalizers will get another chance here, so they are
        // guaranteed to run even if their first invocation threw
        