Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

[core] missing (long)' cast expression when applying operation '<<' #1626

Closed
AIRTEspresso opened this issue Aug 10, 2022 · 0 comments · Fixed by #2326
Closed

[core] missing (long)' cast expression when applying operation '<<' #1626

AIRTEspresso opened this issue Aug 10, 2022 · 0 comments · Fixed by #2326
Labels
bug Core Issues in jadx-core module

Comments

@AIRTEspresso
Copy link

Describe error
Hi. Here is another syntax error, maybe related to missing '(long)' or '(int)' after operand '&='
Source code

class Test {
    long instanceCount;
    void vMeth(long l , int i2 , long l1){
    }
    long lMeth(int i){
        int i1 = 5;
        vMeth(Math.min(instanceCount ,(long)(i1 - 1.472F)<< 45840), i1 , 0L);
        long meth_res = i;
        return meth_res;
    }
}

and here is the decompiled code that cannot pass the compiler checking:

class Test {
    long instanceCount;
    void vMeth(long j, int i, long j2) {
    }
    long lMeth(int i) {
        vMeth(Math.min(this.instanceCount, (5 - 1.472f) << 45840), 5, 0L);
        return i;
    }
}

Here we can see that there missed a '(long)' or '(int)' cast expression before '(5 - 1.472f)', because on default '(5 - 1.472f)' should be a float number and can not be applied to the '<<' operation. Would you like to have a look? All the source file, the compilation file and the decompiled files are available at missingLongCastBefore<<.zip

Version:
Jadx : 1.4.1
Java JDK: 11.0.3
Android decompiler: dx8 of 30.0.2 building tool
Input Version: dex files

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
bug Core Issues in jadx-core module
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant