Closed mtdudek closed 2 years ago
Reproduced with simple example, confirmed that the duplicate parameter name is the issue:
int inner(int a, int b) { return a+2*b; }
template
int sum(int a, int b) { return Test<int,int>(a,b); }
Stack trace:
at ./third_party/xls/contrib/xlscc/translator.h:364
at third_party/xls/contrib/xlscc/translator.cc:1210
at third_party/xls/contrib/xlscc/translator.cc:2645
at third_party/xls/contrib/xlscc/translator.cc:1279
Thank you for looking into this issue. I've tested my suggested patch locally, and it did work, but I think it's more like a hack than proper fix
I have created a fix internally. It is pending code review. You should see it come through tomorrow-ish.
Thanks a lot for the bug report!
Review was quick. I guess external users are motivational. https://github.com/google/xls/commit/515ed2e58601a5b4950a0f5d93b0ed3db484b2d1
Hi,
I found issue with translation class constructors with parameter pack syntax. Example of such constructor:
Issue was due to XLScc creating n parameters with name b, causing name collision and then crash. Tracking down this issue was not that easy, error message from FunctionBuilder::Param got lost somewhere on the way. Please find my patch proposition in attachment: suggestion.txt