mirror of
https://github.com/verilator/verilator.git
synced 2026-10-06 01:54:01 +02:00
Fix parametrized defines calling define with comma. [Joshua Wise]
git-svn-id: file://localhost/svn/verilator/trunk/verilator@1048 77ca24e4-aefa-0310-84f0-b9a241c72d87
This commit is contained in:
+10
-1
@@ -911,7 +911,16 @@ int V3PreProcImp::getToken() {
|
||||
string out = defValue(name);
|
||||
UINFO(4,"Defref `"<<name<<" => '"<<out<<"'"<<endl);
|
||||
// Similar code in parenthesized define (Search for END_OF_DEFARG)
|
||||
m_lexp->unputString(out.c_str());
|
||||
if (m_defRefs.empty()) {
|
||||
// Just output the substitution
|
||||
m_lexp->unputString(out.c_str());
|
||||
} else {
|
||||
// Inside another define. Can't subst now, or
|
||||
// `define a x,y
|
||||
// foo(`a,`b) would break because a contains comma
|
||||
V3DefineRef* refp = &(m_defRefs.top());
|
||||
refp->nextarg(refp->nextarg()+m_lexp->m_defValue+out); m_lexp->m_defValue="";
|
||||
}
|
||||
goto next_tok;
|
||||
}
|
||||
else { // Found, with parameters
|
||||
|
||||
Reference in New Issue
Block a user