             fatalError("Unexpected call to decodeMessage()")
         }
 
-        if unknownFieldsStack.count > ProtoReader.recursionLimit {
+        if messageStackDepth > ProtoReader.recursionLimit {
             throw ProtoDecoder.Error.recursionLimitExceeded
         }
 


    private let buffer: ReadBuffer

    /** Buffers for unknown fields as a stack corresponding to message nesting.. */
    private var unknownFieldsStack: [WriteBuffer?] = []

    /** The encoding of the next value to be read. */
    private var nextFieldWireType: FieldWireType? = nil

    init(buffer: ReadBuffer) {
        self.buffer = buffer
        self.state = .lengthDelimited(length: buffer.count)
        self.messageStackDepth = 1
    }

    // MARK: - Public Methods - Iterating Tags
