Permalink
Browse files

Fix bug in pop().

  • Loading branch information...
1 parent 3e24e48 commit f3872b4954565aa0de3f37eba3d4e63bbb2ab447 @rjpower committed Jan 7, 2014
Showing with 7 additions and 1 deletion.
  1. +7 −1 src/falcon/reval.h
View
@@ -68,7 +68,13 @@ struct SmallVector {
}
T pop() {
- return vals_[--count_];
+ if (count_ < kSVBuiltinSlots) {
+ return vals_[--count_];
+ } else {
+ T result = rest_[count_ - kSVBuiltinSlots - 1];
+ --count_;
+ return result;
+ }
}
size_t size() const {

0 comments on commit f3872b4

Please sign in to comment.