mirror of
https://github.com/verilator/verilator.git
synced 2026-10-06 01:54:01 +02:00
Fix parametrized defines with empty arguments.
This commit is contained in:
+3
-1
@@ -511,7 +511,9 @@ string V3PreProcImp::defineSubst(V3DefineRef* refp) {
|
||||
if (*cp=='"') quote=!quote;
|
||||
if (*cp) token += *cp;
|
||||
}
|
||||
if (refp->args().size() > numArgs) {
|
||||
if (refp->args().size() > numArgs
|
||||
// `define X() is ok to call with nothing
|
||||
&& !(refp->args().size()==1 && numArgs==0 && trimWhitespace(refp->args()[0],false)=="")) {
|
||||
fileline()->v3error("Define passed too many arguments: "+refp->name()+"\n");
|
||||
return " `"+refp->name()+" ";
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user