Skip to content

Crash in AddToTable #7

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
leeonix opened this issue Jun 7, 2014 · 2 comments
Open

Crash in AddToTable #7

leeonix opened this issue Jun 7, 2014 · 2 comments

Comments

@leeonix
Copy link

leeonix commented Jun 7, 2014

i try to decompile a file. but crash at

void AddToTable(Function* F, DecTable * tbl, char *value, char *key)
{
   DecTableItem *item;
   List *type;
   int index;
   if (key == NULL) {
      type = &(tbl->numeric);
      index = tbl->topNumeric;
      tbl->topNumeric++;
   } else {
      type = &(tbl->keyed);
      tbl->used++;
      index = 0;
   }
   item = NewTableItem(value, index, key);  <-- Crach at this
   AddToList(type, (ListItem *) item);
   // FIXME: should work with arrays, too
   if (tbl->keyedSize == tbl->used && tbl->arraySize == 0) {
      PrintTable(F, tbl->reg, 0);
      if (error)
         return;
   }
}

because CloseTable delete a table so index is invaild.

void CloseTable(Function * F, int r)
{
   DecTable *tbl = (DecTable *) PopFromList(&(F->tables));
   if (tbl->reg != r) {
      SET_ERROR(F,"Unhandled construct in table");
      return;
   }
   DeleteTable(tbl);
   F->Rtabl[r] = 0;
}

i upload a file. you can test it.

@sztupy
Copy link
Owner

sztupy commented Dec 4, 2014

Can you upload the file somewhere accessible?

@sztupy sztupy closed this as completed Dec 4, 2014
@sztupy sztupy reopened this Dec 4, 2014
@leeonix
Copy link
Author

leeonix commented Dec 14, 2014

OMG, u reply me after half a year... i already forget what's going on...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants