New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
analyzeWork can occasionally get into an infinite loop #13
Comments
Hmm. I'd really like to see a minimal ROM which causes this misbehavior. To get to the heart of this issue we need to see how a return instruction has its own address in its reaching set. |
Starting from the deep8 sample that exhibits the behavior, I was able to reduce down to this program: edit: a little more reduction
|
I've stepped through the decompile of the above program and identified the point where the return gets its own adress in its reaching set.
|
I was able to reproduce this with no other code except nested calls and returns
|
This is about as minimal as can be, but it relies on sharing a return instruction, so it may be a different edge case?
|
This is pretty close to minimal without sharing instructions.
|
Well, the shared example clearly has a return instruction which should have itself in its own successor set due to fallthrough. I'm surprised the analyzer keeps iterating in that case, though, as it shouldn't be inferring any new reaching values. |
It keeps iterating because the return instruction will always be a child of itself and be pushed back into fringe. |
Yes, I see now. Returns were treated specially, defeating the implicit check of whether we expanded the set of reaching definitions. |
The reaching set of an address representing a return ( 0xEE) can somehow have itself as a successor. This can result in an infinite loop.
The text was updated successfully, but these errors were encountered: