projects
/
platform
/
upstream
/
libpinyin.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
a8421c0
)
fixes crash
author
Peng Wu
<alexepico@gmail.com>
Mon, 18 Feb 2013 06:36:13 +0000
(14:36 +0800)
committer
Peng Wu
<alexepico@gmail.com>
Mon, 18 Feb 2013 06:36:13 +0000
(14:36 +0800)
src/storage/phrase_index.cpp
patch
|
blob
|
history
diff --git
a/src/storage/phrase_index.cpp
b/src/storage/phrase_index.cpp
index
3df14f5
..
5904549
100644
(file)
--- a/
src/storage/phrase_index.cpp
+++ b/
src/storage/phrase_index.cpp
@@
-564,6
+564,13
@@
int SubPhraseIndex::get_range(/* out */ PhraseIndexRange & range){
const table_offset_t * begin = (const table_offset_t *)m_phrase_index.begin();
const table_offset_t * end = (const table_offset_t *)m_phrase_index.end();
+ if (begin == end) {
+ /* skip empty sub phrase index. */
+ range.m_range_begin = 1;
+ range.m_range_end = 1;
+ return ERROR_OK;
+ }
+
/* remove trailing zeros. */
const table_offset_t * poffset = 0;
for (poffset = end - 1; poffset >= begin + 1; --poffset) {