Skip to content

Commit 4485571

Browse files
committed
error message for parameter access
1 parent 1320005 commit 4485571

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

main.cc

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -603,7 +603,8 @@ static int id_obj_to_siminfo (ActSimObj *obj,
603603
return 0;
604604
}
605605

606-
if (!si->bnl->cur->FullLookup (id, NULL)) {
606+
InstType *it;
607+
if (!(it = si->bnl->cur->FullLookup (id, NULL))) {
607608
fprintf (stderr, "Could not find identifier `");
608609
id->Print (stderr);
609610
fprintf (stderr, "' within process `%s'\n", obj->getProc()->getName());
@@ -617,6 +618,13 @@ static int id_obj_to_siminfo (ActSimObj *obj,
617618
return 0;
618619
}
619620

621+
if (TypeFactory::isParamType (it)) {
622+
fprintf (stderr, "Operation only works for a circuit object, not parameter `");
623+
id->Print (stderr);
624+
fprintf (stderr, "'\n");
625+
return 0;
626+
}
627+
620628
c = id->Canonical (si->bnl->cur);
621629
Assert (c, "What?");
622630

0 commit comments

Comments
 (0)