summaryrefslogtreecommitdiffstats
path: root/src/storage/flexible_ngram_kyotodb.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/storage/flexible_ngram_kyotodb.h')
-rw-r--r--src/storage/flexible_ngram_kyotodb.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/storage/flexible_ngram_kyotodb.h b/src/storage/flexible_ngram_kyotodb.h
index 660681e..1c1b1db 100644
--- a/src/storage/flexible_ngram_kyotodb.h
+++ b/src/storage/flexible_ngram_kyotodb.h
@@ -392,8 +392,10 @@ public:
const char * kbuf = (char *) &index;
const size_t ksiz = sizeof(phrase_token_t);
- const int32_t vsiz = m_db->check(kbuf, ksiz);
- if (-1 != vsiz) { /* success */
+ int32_t vsiz = m_db->check(kbuf, ksiz);
+ if (-1 == vsiz) { /* not found. */
+ vsiz = sizeof(ArrayHeader);
+ } else { /* found */
m_chunk.set_size(vsiz);
char * vbuf = (char *) m_chunk.begin();
assert(vsiz == m_db->get(kbuf, ksiz, vbuf, vsiz));