Detect null arguments to concatenation operator.

This commit is contained in:
steve 2003-01-19 00:35:39 +00:00
parent dfc9a9474a
commit 07a427bf28
2 changed files with 24 additions and 2 deletions

View File

@ -17,7 +17,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/ */
#ifdef HAVE_CVS_IDENT #ifdef HAVE_CVS_IDENT
#ident "$Id: elab_lval.cc,v 1.23 2002/11/21 23:27:51 steve Exp $" #ident "$Id: elab_lval.cc,v 1.24 2003/01/19 00:35:39 steve Exp $"
#endif #endif
# include "config.h" # include "config.h"
@ -103,6 +103,14 @@ NetAssign_* PEConcat::elaborate_lval(Design*des, NetScope*scope) const
NetAssign_*res = 0; NetAssign_*res = 0;
for (unsigned idx = 0 ; idx < parms_.count() ; idx += 1) { for (unsigned idx = 0 ; idx < parms_.count() ; idx += 1) {
if (parms_[idx] == 0) {
cerr << get_line() << ": error: Empty expressions "
<< "not allowed in concatenations." << endl;
des->errors += 1;
continue;
}
NetAssign_*tmp = parms_[idx]->elaborate_lval(des, scope); NetAssign_*tmp = parms_[idx]->elaborate_lval(des, scope);
/* If the l-value doesn't elaborate, the error was /* If the l-value doesn't elaborate, the error was
@ -329,6 +337,9 @@ NetAssign_* PENumber::elaborate_lval(Design*des, NetScope*) const
/* /*
* $Log: elab_lval.cc,v $ * $Log: elab_lval.cc,v $
* Revision 1.24 2003/01/19 00:35:39 steve
* Detect null arguments to concatenation operator.
*
* Revision 1.23 2002/11/21 23:27:51 steve * Revision 1.23 2002/11/21 23:27:51 steve
* Precalculate indices to l-value arrays. * Precalculate indices to l-value arrays.
* *

View File

@ -17,7 +17,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/ */
#ifdef HAVE_CVS_IDENT #ifdef HAVE_CVS_IDENT
#ident "$Id: elab_net.cc,v 1.104 2003/01/17 05:48:35 steve Exp $" #ident "$Id: elab_net.cc,v 1.105 2003/01/19 00:35:39 steve Exp $"
#endif #endif
# include "config.h" # include "config.h"
@ -1458,6 +1458,14 @@ NetNet* PEConcat::elaborate_lnet(Design*des, NetScope*scope,
/* Elaborate the operands of the concatenation. */ /* Elaborate the operands of the concatenation. */
for (unsigned idx = 0 ; idx < nets.count() ; idx += 1) { for (unsigned idx = 0 ; idx < nets.count() ; idx += 1) {
if (parms_[idx] == 0) {
cerr << get_line() << ": error: Empty expressions "
<< "not allowed in concatenations." << endl;
errors += 1;
continue;
}
nets[idx] = parms_[idx]->elaborate_lnet(des, scope, nets[idx] = parms_[idx]->elaborate_lnet(des, scope,
implicit_net_ok); implicit_net_ok);
if (nets[idx] == 0) if (nets[idx] == 0)
@ -2276,6 +2284,9 @@ NetNet* PEUnary::elaborate_net(Design*des, NetScope*scope,
/* /*
* $Log: elab_net.cc,v $ * $Log: elab_net.cc,v $
* Revision 1.105 2003/01/19 00:35:39 steve
* Detect null arguments to concatenation operator.
*
* Revision 1.104 2003/01/17 05:48:35 steve * Revision 1.104 2003/01/17 05:48:35 steve
* Remove useless variable. * Remove useless variable.
* *