diff options
author | edwardgao <edwardgao@9a26d1b7-1c8f-445c-8fdd-6576f508279d> | 2011-12-31 02:50:07 +0400 |
---|---|---|
committer | edwardgao <edwardgao@9a26d1b7-1c8f-445c-8fdd-6576f508279d> | 2011-12-31 02:50:07 +0400 |
commit | 8abe8841bf0e269ebb294330fc46244e7ad71ff6 (patch) | |
tree | 5eaa4664c381b5c4d177e25f18c4a7006555913f | |
parent | 630bf0b828c6831edce009da5b209c6f07cda027 (diff) |
Fix TTable Violaion
-rw-r--r-- | mgizapp/src/TTables.h | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/mgizapp/src/TTables.h b/mgizapp/src/TTables.h index dec2963..f6be652 100644 --- a/mgizapp/src/TTables.h +++ b/mgizapp/src/TTables.h @@ -176,7 +176,7 @@ public: CPPair*find(int e,int f){ //pair<unsigned int,CPPair> *be=&(fs[0])+es[e]; //pair<unsigned int,CPPair> *en=&(fs[0])+es[e+1]; - if(e>lexmat.size()||lexmat[e]==NULL){ + if(e>=lexmat.size()||lexmat[e]==NULL){ return NULL; } pair<unsigned int,CPPair> *be=&(*lexmat[e])[0]; @@ -191,6 +191,9 @@ public: } const CPPair*find(int e,int f)const{ + if(e>=lexmat.size()||lexmat[e]==NULL){ + return NULL; + } const pair<unsigned int,CPPair> *be=&(*lexmat[e])[0]; const pair<unsigned int,CPPair> *en=&(*lexmat[e])[0]+(*lexmat[e]).size(); //const pair<unsigned int,CPPair> *be=&(fs[0])+es[e]; |