0

I need to map java bytecode to the java source level, especially conditionals. However, as java bytecode conditions are revered sometimes ( not all the time though), it's hard to achieve the goal. Is there a way to tell the java compiler to stop reversing the conditionals?

  • 1
    What do you mean with “reversed”? The fact that ”if C do X” gets compiled to “if not C jump over X”? That’s fundamental and not configurable. It’s also not hard to translate it back. – Holger Jun 01 '21 at 10:45
  • it is not hard to translate back, but how do I know that it was translated? I have noticed that not all the comparisons are translated – middle-mood Jun 01 '21 at 15:21
  • 1
    [As discussed here](https://stackoverflow.com/q/42562666/2711488), `javac` always uses the same strategy for `if`. Perhaps, you are referring to backward branches being part of a loop. Their conditions match the “proceed as long as C” logic, obviously. But the actual challenge is to identify which control flow construct you’re looking at. There is no way to do this without ambiguity. See also [this answer](https://stackoverflow.com/a/40264833/2711488) and [that answer](https://stackoverflow.com/a/23780774/2711488). – Holger Jun 01 '21 at 15:34

0 Answers0