mirror of
https://github.com/VectorCamp/vectorscan.git
synced 2025-06-28 16:41:01 +03:00
Add explicit casts to succ table entry calculations.
Although overflow should not be possible given the range of alphaShift, this resolves coverity scan issues CID 158536 and CID 158537.
This commit is contained in:
parent
83e69cc195
commit
c699e98750
@ -606,7 +606,7 @@ void fill_in_succ_table_16(NFA *nfa, const dfa_info &info,
|
||||
|
||||
for (size_t s = 0; s < info.impl_alpha_size; s++) {
|
||||
dstate_id_t raw_succ = info.states[i].next[s];
|
||||
u16 &entry = succ_table[(normal_id << alphaShift) + s];
|
||||
u16 &entry = succ_table[((size_t)normal_id << alphaShift) + s];
|
||||
|
||||
entry = info.implId(raw_succ);
|
||||
entry |= get_edge_flags(nfa, entry);
|
||||
@ -916,7 +916,8 @@ void fill_in_succ_table_8(NFA *nfa, const dfa_info &info,
|
||||
|
||||
for (size_t s = 0; s < info.impl_alpha_size; s++) {
|
||||
dstate_id_t raw_succ = info.states[i].next[s];
|
||||
succ_table[(normal_id << alphaShift) + s] = info.implId(raw_succ);
|
||||
succ_table[((size_t)normal_id << alphaShift) + s]
|
||||
= info.implId(raw_succ);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user