[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Tinycc-devel] [bug fix]tcc_load_dll
From: |
Tao Wu |
Subject: |
[Tinycc-devel] [bug fix]tcc_load_dll |
Date: |
Mon, 27 Jun 2005 23:03:57 +0800 |
Hi,
There is a bug in tcc_load_dll function in tccelf.c. Variable "i"
was used in internal an externel loop at the same time. The following
patch should fix it.
--- tcc-0.9.23/tccelf.c 2005-06-18 06:09:15.000000000 +0800
+++ tcc-0.9.23-lepton/tccelf.c 2005-06-27 00:27:39.000000000 +0800
@@ -2095,7 +2095,7 @@
{
Elf32_Ehdr ehdr;
Elf32_Shdr *shdr, *sh, *sh1;
- int i, nb_syms, nb_dts, sym_bind, ret;
+ int i, j, nb_syms, nb_dts, sym_bind, ret;
Elf32_Sym *sym, *dynsym;
Elf32_Dyn *dt, *dynamic;
unsigned char *dynstr;
@@ -2184,8 +2184,8 @@
switch(dt->d_tag) {
case DT_NEEDED:
name = dynstr + dt->d_un.d_val;
- for(i = 0; i < s1->nb_loaded_dlls; i++) {
- dllref = s1->loaded_dlls[i];
+ for(j = 0; j < s1->nb_loaded_dlls; j++) {
+ dllref = s1->loaded_dlls[j];
if (!strcmp(name, dllref->name))
goto already_loaded;
}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Tinycc-devel] [bug fix]tcc_load_dll,
Tao Wu <=