binaryninja-api icon indicating copy to clipboard operation
binaryninja-api copied to clipboard

Prefer code duplication and break over exiting loop with goto

Open plafosse opened this issue 1 year ago • 0 comments

What is the feature you'd like to have? Given code with this pattern:

140771d61                      if (a)
140771d75                          label_140771d75_1:
140771d75                          do_something1()
140771d61                      else
140771d67                          while (b)
140771d69                              do_something2()
140771d73                              if (c)
140771d73                                  goto label_140771d75_1
140771d8f                          do_something3()

Prefer code duplication and break over exiting loop with goto

if (a)
    do_something1()
else
    while (b)
        do_something2()
        if (c)
          do_something1()
          break
    do_something3()

treasure sloth surfboard sing @ 140771d61

plafosse avatar Jun 30 '24 13:06 plafosse