Skip to content

[Bug]: Jimple uses value assigned to the variable instead of the variable itself #1395

@brenkec

Description

@brenkec

What happened?

For the following code:

`package com.demo;

import java.security.spec.RSAKeyGenParameterSpec;

public class demo {
public void demo() {
int keySize = 2048;

    RSAKeyGenParameterSpec rsaKeyGenParameterSpec = new RSAKeyGenParameterSpec(keySize, RSAKeyGenParameterSpec.F0);
}

}`

I get the following jimple representation (from javaSootMethod.getBody() of the demo method):

`{
com.demo.demo this;
java.math.BigInteger $stack3;
java.security.spec.RSAKeyGenParameterSpec $stack4, rsaKeyGenParameterSpec;
short keySize;

this := @this: com.demo.demo;
keySize = 2048;
$stack4 = new java.security.spec.RSAKeyGenParameterSpec;
$stack3 = <java.security.spec.RSAKeyGenParameterSpec: java.math.BigInteger F0>;
specialinvoke $stack4.<java.security.spec.RSAKeyGenParameterSpec: void <init>(int,java.math.BigInteger)>(2048, $stack3);
rsaKeyGenParameterSpec = $stack4;

return;

}`

The problem is that the actual constructor in the source code uses the parameter "keySize" while the jimple representation uses the literal "2048".

Version

Latest release (e.g. via Maven)

Relevant log output

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions