js-confuser icon indicating copy to clipboard operation
js-confuser copied to clipboard

Control Flow Flattening breaks nested redefined function declaration

Open MichaelXF opened this issue 1 year ago • 0 comments

Config and Small code sample

Config:

{
  target: "node",
  controlFlowFlattening: true
}

Code:

if (true) {
  function myFunction() {
    console.log("Top Function Declaration");
  }

  function myFunction() {
    console.log("Bottom Function Declaration");
  }
}

var filler;

myFunction(); // "Bottom Function Declaration"

Expected behavior

The program should output "Bottom Function Declaration"

Actual behavior

The program outputs "Top Function Declaration"

MichaelXF avatar Jun 06 '23 04:06 MichaelXF