Permalink
Browse files

Fix field skipping code.

  • Loading branch information...
1 parent ea283a7 commit b04325163e5cdf06b169e77eee69c526fb15b532 @brown committed Apr 24, 2012
Showing with 5 additions and 5 deletions.
  1. +5 −5 wire-format.lisp
View
@@ -94,11 +94,11 @@
(#.+start-group+
(loop (multiple-value-bind (tag new-index)
(varint:parse-uint32-carefully buffer index limit)
- (if (/= (ldb (byte 3 0) tag) +end-group+)
- (setf index (skip-field buffer new-index limit tag))
- (prog1 new-index
- (unless (= (- start-tag +start-group+) (- tag +end-group+))
- (error 'alignment)))))))
+ (cond ((/= (ldb (byte 3 0) tag) +end-group+)
+ (setf index (skip-field buffer new-index limit tag)))
+ ((= (- start-tag +start-group+) (- tag +end-group+))
+ (return new-index))
+ (t (error 'alignment))))))
(#.+fixed32+
(let ((new-index (+ index 4)))
(when (> new-index index) (error 'data-exhausted))

0 comments on commit b043251

Please sign in to comment.