diff --git a/sourcepawn/compiler/pawncc.c b/sourcepawn/compiler/pawncc.c index 43030f13..a64ac5aa 100644 --- a/sourcepawn/compiler/pawncc.c +++ b/sourcepawn/compiler/pawncc.c @@ -174,17 +174,19 @@ int main(int argc, char *argv[]) { sp_file_publics_t *pbtbl; AMX_FUNCSTUBNT *stub; + unsigned char *stubptr; uint32_t publics = sections[FS_Publics]; pbtbl = (sp_file_publics_t *)malloc(sizeof(sp_file_publics_t) * publics); - stub = (AMX_FUNCSTUBNT *)((unsigned char *)hdr + hdr->publics); + stubptr = (unsigned char *)hdr + hdr->publics; for (i=0; iaddress; pbtbl[i].name = stub->nameofs - (hdr->nametable + sizeof(uint16_t)); - stub += hdr->defsize; + stubptr += hdr->defsize; } if (publics) { @@ -199,17 +201,19 @@ int main(int argc, char *argv[]) { sp_file_pubvars_t *pbvars; AMX_FUNCSTUBNT *stub; + unsigned char *stubptr; uint32_t pubvars = sections[FS_Pubvars]; pbvars = (sp_file_pubvars_t *)malloc(sizeof(sp_file_pubvars_t) * pubvars); - stub = (AMX_FUNCSTUBNT *)((unsigned char *)hdr + hdr->pubvars); + stubptr = (unsigned char *)hdr + hdr->pubvars; for (i=0; iaddress; pbvars[i].name = stub->nameofs - (hdr->nametable + sizeof(uint16_t)); - stub += hdr->defsize; + stubptr += hdr->defsize; } if (pubvars) { @@ -223,16 +227,18 @@ int main(int argc, char *argv[]) { sp_file_natives_t *nvtbl; AMX_FUNCSTUBNT *stub; + unsigned char *stubptr; uint32_t natives = (hdr->libraries - hdr->natives) / hdr->defsize; nvtbl = (sp_file_natives_t *)malloc(sizeof(sp_file_natives_t) * natives); - stub = (AMX_FUNCSTUBNT *)((unsigned char *)hdr + hdr->natives); + stubptr = (unsigned char *)hdr + hdr->natives; for (i=0; inameofs - (hdr->nametable + sizeof(uint16_t)); - stub += hdr->defsize; + stubptr += hdr->defsize; } if (natives) {