fixed bug #2593369 - global labels in unused functions can't be used
git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@5937 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
parent
f4a282b8eb
commit
80b8e010ad
1 changed files with 19 additions and 0 deletions
|
@ -1275,6 +1275,25 @@ int CEXEBuild::resolve_jump_int(const char *fn, int *a, int offs, int start, int
|
||||||
{
|
{
|
||||||
*a = s->code+1; // jumps are to the absolute position, +1 (to differentiate between no jump, and jumping to offset 0)
|
*a = s->code+1; // jumps are to the absolute position, +1 (to differentiate between no jump, and jumping to offset 0)
|
||||||
s->flags++;
|
s->flags++;
|
||||||
|
if (*lname == '.')
|
||||||
|
{
|
||||||
|
// bug #2593369 - mark functions with used global labels as used
|
||||||
|
// XXX this puts another hole in function reference counting
|
||||||
|
// a recursive function, for example, will never be optimized
|
||||||
|
int nf=cur_functions->getlen()/sizeof(section);
|
||||||
|
section *func=(section *)cur_functions->get();
|
||||||
|
while (nf-- > 0)
|
||||||
|
{
|
||||||
|
int fstart = func->code;
|
||||||
|
int fend = func->code + func->code_size;
|
||||||
|
if (s->code >= fstart && s->code <= fend)
|
||||||
|
{
|
||||||
|
func->flags++;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
func++;
|
||||||
|
}
|
||||||
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
s++;
|
s++;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue