diff --git a/Changes b/Changes index bc774e2ea..7b1fae7f8 100644 --- a/Changes +++ b/Changes @@ -12,7 +12,9 @@ indicates the contributor was also the author of the fix; Thanks! *** Support arrayed SystemC I/O pins. [Christophe Joly] -**** Fix core dump with over 100 deep UNOPTFLAT, bug432. [Joe Eiler] +**** Fix expansion of back-slashed escaped macros, bug441. [Alberto Del Rio] + +**** Fix core dump with over 100 deep UNOPTFLAT, bug432. [Joe Eiler] **** Fix false command not found warning in makefiles. [Ruben Diez] diff --git a/src/V3PreLex.l b/src/V3PreLex.l index 356491710..241376870 100644 --- a/src/V3PreLex.l +++ b/src/V3PreLex.l @@ -81,6 +81,7 @@ quote [\"] tickquote [`][\"] backslash [\\] /* Where we use symb/symbdef, we must also look for a `` join */ +/* Note in the preprocessor \ESCaped is *not* always special; mantis1537/bug441 */ symb ([a-zA-Z_][a-zA-Z0-9_$]*|\\[^ \t\f\r\n]+) symbdef ([a-zA-Z_][a-zA-Z0-9_$]*|\\[^ \t\f\r\n`]+) word [a-zA-Z0-9_]+ diff --git a/src/V3PreProc.cpp b/src/V3PreProc.cpp index deb5e0dbb..0fae023e0 100644 --- a/src/V3PreProc.cpp +++ b/src/V3PreProc.cpp @@ -628,16 +628,18 @@ string V3PreProcImp::defineSubst(V3DefineRef* refp) { string argName; string prev; bool quote = false; + bool backslashesc = false; // In \.....{space} block // Note we go through the loop once more at the NULL end-of-string for (const char* cp=value.c_str(); (*cp) || argName!=""; cp=(*cp?cp+1:cp)) { - //cout << "CH "<<*cp<<" an "<