Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions apps/amxxpc/src/amxxpc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,7 @@ void ReadFileIntoPl(abl* pl, FILE* fp)
}
pl->size = size;
pl->data = new char[size];
memset(pl->data, 0, size);
rewind(fp);
fread(pl->data, 1, size, fp);
}
Expand Down
11 changes: 9 additions & 2 deletions libs/amxxpc32/src/sc1.c
Original file line number Diff line number Diff line change
Expand Up @@ -1994,6 +1994,10 @@ static void parse(void)
static void dumplits(void)
{
int k = 0;

if (sc_status == statSKIP) {
return;
}
while (k < litidx) {
/* should be in the data segment */
assert(curseg == 2);
Expand All @@ -2017,11 +2021,14 @@ static void dumplits(void)

/* dumpzero
*
* Dump zero's for default initial values
* Dump zero's for default initial values of elements of global arrays.
* Elements of local arrays do not need to be dumped, because they are
* allocated on the stack (and the stack is cleared when creating a new
* variable).
*/
static void dumpzero(int count)
{
if (count <= 0) {
if (sc_status == statSKIP || count <= 0) {
return;
}
assert(curseg == 2);
Expand Down
11 changes: 8 additions & 3 deletions libs/amxxpc32/src/sc6.c
Original file line number Diff line number Diff line change
Expand Up @@ -1063,9 +1063,14 @@ static void append_dbginfo(FILE* fout)
assert(str[0] != '\0' && str[1] == ':');
if (str[0] == 'S') {
dbghdr.symbols++;
name = strchr(str + 2, ':');
assert(name != NULL);
dbghdr.size += sizeof(AMX_DBG_SYMBOL) + strlen(skipwhitespace(name + 1));
str = strchr(str + 2, ':');
assert(str != NULL);
name = skipwhitespace(str + 1);
str = strchr(name, ' ');
assert(str != NULL);
assert((unsigned)(str - name) < sizeof symname);
const uint32_t namelen = str ? (str - name) : strlen(name);
dbghdr.size += (int32_t)(sizeof(AMX_DBG_SYMBOL) + namelen);
if ((prevstr = strchr(name, '[')) != NULL) {
while ((prevstr = strchr(prevstr + 1, ':')) != NULL) {
dbghdr.size += sizeof(AMX_DBG_SYMDIM);
Expand Down
Loading