Intelligent-CAT-Lab / PLTranslationEmpirical

Artifact repository for the paper "Lost in Translation: A Study of Bugs Introduced by Large Language Models while Translating Code", In Proceedings of The 46th IEEE/ACM International Conference on Software Engineering (ICSE 2024), Lisbon, Portugal, April 2024
https://zenodo.org/doi/10.5281/zenodo.8190051
MIT License
38 stars 9 forks source link

Update translate_transpiler.py to link math library when required #2

Closed mrigankpawagi closed 3 months ago

mrigankpawagi commented 3 months ago

3 of the compilation errors were thrown by intercept-build and not cargo build. These were due to C programs that included <math.h>, since the -lm flag was not used while compiling to link the math library. This lead to them being incorrectly classified as compilation errors. With this fix, the pipeline can proceed and we can see that C2Rust compiles these to correct Rust programs (thus increasing the accuracy on the codenet/C dataset to 96.5%).

alibrahimzada commented 3 months ago

This is a valid case that could happen. Earlier, we did not consider errors happening from intercept-build.