History

Don't call elf_hash on NULL value

Make sur elf_hash is never invoked with a NULL value.

Domingo Alvarez Duarte committed 13 years ago

Commit 505329b1 parent 93785141 file · +1 −1Browse files

Unified · Split

tccelf.c+1−1
@@ -114,7 +114,7 @@ ST_FUNC int put_elf_sym(Section *s, uplong value, unsigned long size, · 113 unmodified lines
114 if (ELFW(ST_BIND)(info) != STB_LOCAL) {114 if (ELFW(ST_BIND)(info) != STB_LOCAL) {
115 /* add another hashing entry */115 /* add another hashing entry */
116 nbuckets = base[0];116 nbuckets = base[0];
117 h = elf_hash(name) % nbuckets;117 h = name ? elf_hash(name) % nbuckets : 0;
118 *ptr = base[2 + h];118 *ptr = base[2 + h];
119 base[2 + h] = sym_index;119 base[2 + h] = sym_index;
120 base[1]++;120 base[1]++;

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t