pkuzqh / Recoder

MIT License
52 stars 11 forks source link

Post processing failure on some cases #13

Closed claudeyj closed 1 year ago

claudeyj commented 1 year ago

Hi Dr. Zhu, I'm using your Recoder tool to repair some new bugs and it turns out to be really so powerful! But I observed that on some cases it may fail in post processing phase and I wonder you can help confirm that. In your testone.py script which is the core component of Recoder, https://github.com/pkuzqh/Recoder/blob/83de1432eb7994f88de62c20c4d42a8bf54a683e/testone.py#L441 tries to judge whether there's a throw statement in lines[0]. This lines is directly from aftercode which is part of the context. But for some special cases where the buggy method is too short (e.g. only one line, like int sum(int a, int b) { return a + b;}), the aftercode is actually empty and so is lines. Therefore lines[0] will trigger an Index Error: list out of range error. I think fixing this issue may help Recoder to fix more bugs. Thank you for taking a look.

pkuzqh commented 1 year ago

Thanks a lot. I have fixed it.