fixed segfault, but am now having a new unknown one :(

This commit is contained in:
Scarlett
2025-04-07 17:00:24 -04:00
parent 4058b090a0
commit e7ee370dcf
3 changed files with 9 additions and 10 deletions

View File

@ -624,10 +624,9 @@ assignable:
//char *funtype = getType(look_up(cur, $1));
printdebug("%s", getType(look_up(cur, getName((TableNode*)$1))));
// Something fishy is going on here.......
TableNode *param = getParameter(look_up(getParent(cur), getName((TableNode*)$1)));
printTableNode(table_lookup(getAncestor(cur), getName((TableNode*)$1)));
TableNode * typeNode = table_lookup(getAncestor(cur), getType((TableNode*)$1));
TableNode *param = getParameter(typeNode);
printTableNode(param);
SymbolTable *recList = getRecList(param);
TableNode *lastCheckedRef = getFirstEntry(recList);

View File

@ -1150,6 +1150,11 @@ TableNode *printTableNode(TableNode *tn) {
printdebug("%s[PrintTN] Passed a NULL tablenode!", COLOR_RED);
return undefined;
}
if (tn == undefined) {
printdebug("%s[PrintTN] Passed an undefined tablenode!",
COLOR_RED);
return undefined;
}
if (tn->theName == NULL) {
printdebug("%s[PrintTN] Passed a tablenode with NULL name!",
COLOR_RED);
@ -1160,11 +1165,6 @@ TableNode *printTableNode(TableNode *tn) {
COLOR_RED);
return undefined;
}
if (tn == undefined) {
printdebug("%s[PrintTN] Passed an undefined tablenode!",
COLOR_RED);
return undefined;
}
if (tn->additionalinfo == NULL) {
printdebug(
"%s[PrintTN] Passed a tablenode with NULL additional info!",

View File

@ -78,4 +78,4 @@ entry (arg) := {
result := bar2(5,7);
return 0;
}
}