case SK_PARAM:
llassert (s->info->paramno >= -1);
- llassert (s->info->paramno <= 50); /*@i32 bogus...*/
+ llassert (s->info->paramno <= 999); /* sanity check */
break;
case SK_ARRAYFETCH:
/* start modifications */
s->bufinfo.bufstate = BB_NOTNULLTERMINATED;
- s->bufinfo.size = -1; /*@i24 unknown@*/
- s->bufinfo.len = -1; /*@i24 unknown@*/
+ s->bufinfo.size = -1;
+ s->bufinfo.len = -1;
/* end modifications */
s->aliaskind = AK_UNKNOWN;
switch (base->kind)
{
case SK_PARAM:
- res = usymtab_getRefQuiet (paramsScope, base->info->paramno);
+ res = usymtab_getRefQuiet (paramsScope, usymId_fromInt (base->info->paramno));
break;
case SK_CVAR:
uentry ue = sRef_getUentry (s);
/* must be raw name! (need the marker) */
- ue = usymtab_lookupSafe (uentry_rawName (ue));
+ /* Must be in the correct scope! */
+
+ ue = usymtab_lookupSafeScope (uentry_rawName (ue), sRef_lexLevel (s));
if (uentry_isUndefined (ue))
{
switch (s->kind)
{
case SK_PARAM:
- return (usymtab_getRefQuiet (paramsScope, s->info->paramno));
+ return (usymtab_getRefQuiet (paramsScope, usymId_fromInt (s->info->paramno)));
case SK_CVAR:
return (usymtab_getRefQuiet (s->info->cvar->lexlevel, s->info->cvar->index));
case SK_CONJ:
{
case SK_RESULT:
{
- /* s = sRef_saveCopy(s); */ /*@i523@*/
ce = constraintExpr_makeTermsRef (s);
return ce;
}
{
sRef temp;
temp = (sRef_makePointer (sRef_fixBaseParam (s->info->ref, args)));
- /* temp = sRef_saveCopy(temp); */ /*@i523@*/
ce = constraintExpr_makeTermsRef (temp);
return ce;
}
return ce;
}
case SK_PARAM:
- llassert(exprNodeList_size (args) > s->info->paramno);
- {
- exprNode e = exprNodeList_nth (args, s->info->paramno);
-
- llassert( !(exprNode_isError (e)) );
- ce = constraintExpr_makeExprNode (e);
- return ce;
- }
+ {
+ exprNode e;
+ llassert (exprNodeList_size (args) > s->info->paramno);
+ e = exprNodeList_nth (args, s->info->paramno);
+
+ llassert (!(exprNode_isError (e)));
+ ce = constraintExpr_makeExprNode (e);
+ return ce;
+ }
default:
{
s->kind = SK_ADR;
s->type = ctype_makePointer (t->type);
s->info = (sinfo) dmalloc (sizeof (*s->info));
- s->info->ref = t; /* sRef_copy (t); */ /*@i32@*/
+ s->info->ref = t;
if (t->defstate == SS_UNDEFINED)
/* no! it is allocated even still: && !ctype_isPointer (t->type)) */
sRef
sRef_makeObject (ctype o)
{
- sRef s = sRef_newRef (); /*@i423 same line is bad...@*/
+ sRef s = sRef_newRef ();
s->kind = SK_OBJECT;
s->info = (sinfo) dmalloc (sizeof (*s->info));
s->kind = SK_EXTERNAL;
s->info = (sinfo) dmalloc (sizeof (*s->info));
s->type = t->type;
- s->info->ref = t; /* sRef_copy (t); */ /*@i32 was exposed@*/
+ s->info->ref = t;
llassert (valueTable_isUndefined (s->state));
s->state = context_createValueTable (s, stateInfo_makeLoc (g_currentloc, SA_DECLARED));
return s;
s->kind = SK_DERIVED;
s->info = (sinfo) dmalloc (sizeof (*s->info));
- s->info->ref = t; /* sRef_copy (t); */ /*@i32@*/
+ s->info->ref = t;
s->type = t->type;
llassert (valueTable_isUndefined (s->state));
** Merge value table states
*/
-
- /*@i3245@*/
# if 0
/*
** This doesn't do anything. And its broken too...
s->kind = SK_CONJ;
s->info = (sinfo) dmalloc (sizeof (*s->info));
s->info->conj = (cjinfo) dmalloc (sizeof (*s->info->conj));
- s->info->conj->a = a; /* sRef_copy (a) */ /*@i32*/ ;
- s->info->conj->b = b; /* sRef_copy (b);*/ /*@i32@*/ ;
+ s->info->conj->a = a;
+ s->info->conj->b = b;
if (ctype_equal (a->type, b->type)) s->type = a->type;
else s->type = ctype_makeConj (a->type, b->type);
return ((s->kind == SK_CVAR) &&
(s->info->cvar->lexlevel == functionScope) &&
(context_inFunction () &&
- (s->info->cvar->index <= uentryList_size (context_getParams ()))));
+ (s->info->cvar->index <= usymId_fromInt (uentryList_size (context_getParams ())))));
}
bool sRef_isPointer (sRef s)
s->definfo = stateInfo_undefined;
s->nullinfo = stateInfo_undefined;
- /*@i32@*/ sfree (s);
+ sfree (s);
}
}
s->kind = SK_FIELD;
s->info = (sinfo) dmalloc (sizeof (*s->info));
s->info->field = (fldinfo) dmalloc (sizeof (*s->info->field));
- s->info->field->rec = rec; /* sRef_copy (rec); */ /*@i32@*/
+ s->info->field->rec = rec;
s->info->field->field = f; /* doesn't copy f */
if (ctype_isKnown (ct) && ctype_isSU (ct))
s->info->arrayfetch = (ainfo) dmalloc (sizeof (*s->info->arrayfetch));
s->info->arrayfetch->indknown = FALSE;
s->info->arrayfetch->ind = 0;
- s->info->arrayfetch->arr = arr; /* sRef_copy (arr); */ /*@i32@*/
+ s->info->arrayfetch->arr = arr;
sRef_setArrayFetchState (s, arr);
s->kind = SK_ARRAYFETCH;
s->info = (sinfo) dmalloc (sizeof (*s->info));
s->info->arrayfetch = (ainfo) dmalloc (sizeof (*s->info->arrayfetch));
- s->info->arrayfetch->arr = arr; /* sRef_copy (arr); */ /*@i32@*/
+ s->info->arrayfetch->arr = arr;
s->info->arrayfetch->indknown = TRUE;
s->info->arrayfetch->ind = i;
s->kind = SK_PTR;
s->info = (sinfo) dmalloc (sizeof (*s->info));
- s->info->ref = t; /* sRef_copy (t); */ /*@i32*/
+ s->info->ref = t;
if (ctype_isRealAP (rt))
{
s1->nullstate = s2->nullstate;
s1->nullinfo = stateInfo_update (s1->nullinfo, s2->nullinfo);
- /*@-mustfree@*/
- /*@i834 don't free it: valueTable_free (s1->state); */
- /*@i32@*/ s1->state = valueTable_copy (s2->state);
- /*@=mustfree@*/
+ valueTable_free (s1->state);
+ s1->state = valueTable_copy (s2->state);
s1->safe = s2->safe;
}
}
aliases = usymtab_allAliases (s);
- DPRINTF (("All aliases: %s", sRefSet_unparseFull (aliases)));
+ DPRINTF (("All aliases: %s --> %s", sRef_unparseFull (s), sRefSet_unparseFull (aliases)));
(*predf)(s, loc);
{
if (sRef_isReasonable (current))
{
+ DPRINTF (("Update: %s", sRef_unparseFull (current)));
current = sRef_updateSref (current);
+ DPRINTF (("Updated ==> %s", sRef_unparseFull (current)));
((*predf)(current, loc));
DPRINTF (("Killed: %s", sRef_unparseFull (current)));
}
ret->arrayfetch = (ainfo) dmalloc (sizeof (*ret->arrayfetch));
ret->arrayfetch->indknown = s->info->arrayfetch->indknown;
ret->arrayfetch->ind = s->info->arrayfetch->ind;
- ret->arrayfetch->arr = s->info->arrayfetch->arr; /* sRef_copy (s->info->arrayfetch->arr); */ /*@i32@*/
+ ret->arrayfetch->arr = s->info->arrayfetch->arr;
break;
case SK_FIELD:
ret = (sinfo) dmalloc (sizeof (*ret));
ret->field = (fldinfo) dmalloc (sizeof (*ret->field));
- ret->field->rec = s->info->field->rec; /* sRef_copy (s->info->field->rec); */ /*@i32@*/
+ ret->field->rec = s->info->field->rec;
ret->field->field = s->info->field->field;
break;
case SK_PTR:
case SK_ADR:
case SK_DERIVED:
- case SK_EXTERNAL: /*@i32 is copy now! */
+ case SK_EXTERNAL: /* is copy now! */
break;
case SK_CONJ:
** Default defined state can be made special.
*/
- llassert (sRef_isReasonable (s)); /*@i523 why doesn't null-checking work!??? */
+ llassert (sRef_isReasonable (s));
if (s->defstate == SS_UNKNOWN || s->defstate == SS_DEFINED || s->defstate == SS_SPECIAL)
{