Skip to content

Rest arguement is mishandled when controlFlowFlattening is enabled #920

@zeeker999

Description

@zeeker999

Expected Behavior

Expected output:

function f(e, h, i, j) {
    console['log'](e, h, i, j);
}
function g(...b) {
    const c = {
        'vtpEA': function (d, ...e) {
            return d(...e);
        }
    };
    c['vtpEA'](f, ...b, 0x5);
}
const a = [
    0x1,
    0x2,
    0x3
];
g(...a, 0x4);

Current Behavior

Current output:

function f(e, h, i, j) {
    console['log'](e, h, i, j);
}
function g(...b) {
    const c = {
        'vtpEA': function (d, ...e, h) {
            return d(...e, h);
        }
    };
    c['vtpEA'](f, ...b, 0x5);
}
const a = [
    0x1,
    0x2,
    0x3
];
g(...a, 0x4);

Your Environment

  • Obfuscator version used: 2.12.0
  • Node version used: 14.10.1

Stack trace

Minimal working example that will help to reproduce issue

function f(a, b, c, d) {
  console.log(a, b, c, d)
}

function g(...args) {
  f(...args, 5)
}
const a = [1, 2, 3]
g(...a, 4)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions