updated branch to not crash due to getType issue

This commit is contained in:
Partho Bhattacharya
2025-03-26 16:21:57 -04:00
parent 0ff894d571
commit 27fb88f866

View File

@ -472,11 +472,11 @@ TableNode *CreateEntry(SymbolTable *table, TableNode *typeOf, char *id,
char *getType(TableNode *tn) {
if(tn == NULL){
printf("passed a NULL table entry to getType\n");
return NULL;
return tn;
}
if(tn->theType == NULL){
printf("type of entry is currently NULL, undefined type \n");
return NULL;
return tn;
}
return tn->theType->theName; }
char *getName(TableNode *tn) { return tn->theName; }