fix trie walk
now able to search for symbol with multiple name with same prefix
This commit is contained in:
parent
4fd6bd166e
commit
0d13a70896
@ -319,13 +319,12 @@ void *find_in_export_trie(const void *header, void *trie, const char *symbol) {
|
|||||||
// terminal node will have data
|
// terminal node will have data
|
||||||
uint32_t data_count = 0;
|
uint32_t data_count = 0;
|
||||||
decode_uleb128(ptr, &data_count);
|
decode_uleb128(ptr, &data_count);
|
||||||
if (data_count != 0) {
|
if (data_count != 0 && *find == 0) {
|
||||||
// printf("reached terminal node\n");
|
// printf("reached terminal node\n");
|
||||||
if (*find != 0) {
|
|
||||||
// it reaches terminal node but symbol is not fully scanned
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
|
} else if (data_count) {
|
||||||
|
// still need to follow the branch
|
||||||
|
ptr += data_count;
|
||||||
}
|
}
|
||||||
char num_child = ptr[0];
|
char num_child = ptr[0];
|
||||||
ptr++;
|
ptr++;
|
||||||
|
Loading…
Reference in New Issue
Block a user