/* addSymChain - adds a symbol chain to the symboltable */
/*------------------------------------------------------------------*/
void
-addSymChain (symbol * symHead)
+addSymChain (symbol ** symHead)
{
- symbol *sym = symHead;
+ symbol *sym = *symHead;
symbol *csym = NULL;
+ symbol **symPtrPtr;
int error = 0;
for (; sym != NULL; sym = sym->next)
/* delete current entry */
deleteSym (SymbolTab, csym, csym->name);
deleteFromSeg(csym);
+
+ symPtrPtr = symHead;
+ while (*symPtrPtr && *symPtrPtr != csym)
+ symPtrPtr = &(*symPtrPtr)->next;
+ if (*symPtrPtr == csym)
+ *symPtrPtr = csym->next;
+
}
/* add new entry */
/* if parameter or local variable then change */
/* the storage class to reflect where the var will go */
- if (sym->level && SPEC_SCLS (sym->etype) == S_FIXED &&
- !IS_STATIC(sym->etype))
+ if (sym->level && SPEC_SCLS (sym->etype) == S_FIXED
+ && !IS_STATIC(sym->etype)
+ )
{
if (options.stackAuto || (currFunc && IFFUNC_ISREENT (currFunc->type)))
{
if (IS_PTR (dest) && IS_GENPTR (src) && IS_VOID(src->next)) {
return -1;
}
- if (IS_PTR (src) && IS_GENPTR (dest))
+ if (IS_PTR (src) &&
+ (IS_GENPTR (dest) ||
+ ((DCL_TYPE(src) == POINTER) && (DCL_TYPE(dest) == IPOINTER))
+ ))
return -1;
if (IS_PTR (dest) && IS_ARRAY (src)) {
value *val=aggregateToPointer (valFromType(src));
}
}
+ if (IFFUNC_ISSHADOWREGS(sym->type) && !FUNC_ISISR (sym->type))
+ {
+ werror (E_SHADOWREGS_NO_ISR, sym->name);
+ }
+
+
for (argCnt=1, acargs = FUNC_ARGS(sym->type);
acargs;
acargs=acargs->next, argCnt++) {
werror (E_PREV_DEF_CONFLICT, csym->name, "reentrant");
}
+ if (IFFUNC_ISWPARAM (csym->type) != IFFUNC_ISWPARAM (sym->type))
+ {
+ werror (E_PREV_DEF_CONFLICT, csym->name, "wparam");
+ }
+
+ if (IFFUNC_ISSHADOWREGS (csym->type) != IFFUNC_ISSHADOWREGS (sym->type))
+ {
+ werror (E_PREV_DEF_CONFLICT, csym->name, "shadowregs");
+ }
+
+
/* compare expected args with actual args */
exargs = FUNC_ARGS(csym->type);
acargs = FUNC_ARGS(sym->type);
SPEC_STAT (func->etype);
}
#endif
- addSymChain (val->sym);
+ addSymChain (&val->sym);
}
else /* symbol name given create synth name */