Comments (6)
It would be great to comment it or even don't show any such info.
It doesn't give you any interesting info, but in case of trying to compile it will give you an error.
from cfr.
Thanks for checking the copyright! ;)
I don't think this is a bug, or even bad behaviour - the issue is the explicit pops (well, pop2) in the byte code - compute an expression, and then discard it.
It's very deliberately discarded, and assigning it to an intermediate value is a bit dishonest.
Also, though, throwing away the calculation would be dishonest too. (very much so if it was side effecting, or could throw an exception, even so with the above because, well, it IS being calculated).
To be honest, I think assigning it to a local is bad - that's not what the JVM is doing, and if possible, a decompiler should be honest!
I guess it's possible to add a comment /* discarded value */, but that sort of thing (ignoring return values) happens all the time.
from cfr.
Oh, that's a really good point. Whoops! Guess I'll have to consume (or find a cleaner way of not-a-statement)ing them.
Thanks.
from cfr.
As for example, Krakatau output:
public static String fib(String s) {
int i = s.length();
char[] a = new char[i];
int i0 = i - 1;
while(true) {
if (i0 >= 0) {
int i1 = s.charAt(i0);
int i2 = i0 + -1;
int i3 = (char)(i1 ^ 58);
a[i0] = (char)i3;
if (i2 >= 0) {
i0 = i2 + -1;
int i4 = s.charAt(i2);
int i5 = (char)(i4 ^ 97);
a[i2] = (char)i5;
continue;
}
}
return new String(a);
}
}
Looks great.:) Could you make it the same?) I mean calculating values.
from cfr.
Eh. Here, I'm much less convinced. This hides the fact that the bytecode has some operations in it.
I definitely don't think it's the job of the decompiler to do constant folding - if the compiler hasn't done it, I want to know that!
Consider the difference between
1 | 2 | 4 | 8 | x
and
x | 8 | 4 | 2 | 1
http://www.benf.org/other/cfr/constant-folding.html
from cfr.
Thanks:) Ok, you're right.
from cfr.
Related Issues (20)
- Type argument of null reference generic class variables is converted to Object
- Casting of primitive types may be decompiled as casting of corresponding wrapper classes under certain circumstances
- Type Conversion Expression Lost in Constructor
- Question: Is there any switch to specify a single class to be decompiled? HOT 1
- How can I show the class packages?
- Option to remove the file headers HOT 1
- Question: decompiling multiple files from terminal HOT 1
- How do I decompile using CFR's CFRDriver?
- Decompiling class files from Java bytecode source HOT 2
- Ternary Expression Causing Decompilation Type Error
- Incorrect Comparable Expression Produced by Ternary Expression
- CFR can't handle recent Oracle JDBC jars HOT 1
- CFR omits parentheses in expressions with mixed operators HOT 1
- CFR uses numerical literals instead of constants HOT 4
- CFR omits optional braces after if statements HOT 1
- Extractable last case doesn't follow previous, and can't clone.
- Decompiler HOT 1
- Incorrect decompilation related to certain usages of conditionals in catch blocks HOT 3
- having an issue with the error "Error: Could not find or load main class cfr-0.152.jar" HOT 3
- Missing case in decompiled switch statement
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cfr.