Fix problem with calculation of the 'c_ast.FuncDecl' offset#11
Conversation
|
After a short look on the failed tests ist seems to be a problem of the supplied code in the PR. When compiling the legacy code in WSL using Ubuntu-24.04 and gcc (Ubuntu 13.3.0-6ubuntu2~24.04) 13.3.0 some part of the code pulls the following header into our translation unit. This is accidentally parsed as "typedef" by Nala but tagged as "ast_c.FuncDecl". As a result this function along with some others end up to be in |
…where function pointer typedefs are present in the translation unit.
|
hmm maybe I shouldn't have merged it because the testes fail =) Any change you can create a new PR with a fix? Github actions now use Ubuntu 22.04, which fixes the weird test failures we had before. |
|
I fixed a few test on my fork, but 3 are still failing. I will check tomorrow if I can fix those to. |
|
I'm open to make pretty much any change that improves Nala. I'll not have time to make any changes myself, but can bump the version and publish new releases if needed. |
When parsing some legacy code the inspect module ended up with following error
It turned out, that the reason was a wrong offset of
self.file_ast.ext[i]handed over to functionrename_parameterswhich then tried to replace functions parameters in 'Struct' objects.The quick hack to solve this issue was to search for the first
c_ast.FuncDeclinself.file_ast.extand take this position asfunc_offset.