Comments (4)
Uninformed guess: the code to go from while
to do
+while
finds the conditional break
, but either doesn't check that it is lexically first, or that all sub-statements of the while are conditional.
from rellic.
Here is a fun idea! What if the transform proceeded like this, and I am not claiming correctness of this:
while(1U) {
a = sth;
if(a == 10) { <-- break condition identifier
break; <-- break objserved
}
if(a != 10) {
body;
}
}
wrap all sub-statements in exit condition, after re-forming do-which
if (a != 10) {
a = sth;
}
if (a != 10) {
if(a == 10) {
break;
}
}
if (a != 10) {
if(a != 10) {
body;
}
}
} while (a != 10);
refine1:
do {
if (a != 10) {
a = sth;
}
if (a != 10) {
if(0) {
break;
}
}
if (a != 10) {
if(1) {
body;
}
}
} while (a != 10);
refine2:
do {
if (a != 10) {
a = sth;
}
if (a != 10) {
}
if (a != 10) {
body;
}
} while (a != 10);
refine3:
do {
if (a != 10) {
a = sth;
}
if (a != 10) {
body;
}
} while (a != 10);
refine4:
do {
if (a != 10) {
a = sth;
body;
}
} while (a != 10);
not sure where this is going
from rellic.
anyway, could it possibly be because the do-while condition refinement asserts the while condition before entering the do
, which wouldn't be valid?
from rellic.
What is happening is:
- the
if(a == 10) { break; } if(!(a == 10)) { body; }
is turned intoif(a == 10) {break;} else {body;}
- the
if
is recognized as being the stopping condition for ado...while
byLoopRefine
. Theelse
body is added to the loop without a guard
What should happen instead is that the else
body should be added guarded by !(a == 10)
.
from rellic.
Related Issues (20)
- Could `NestedCondProp` also propagate `while` conditions?
- Move invalid store handling to an LLVM pass
- memcpy intrinsic tests failing on ARM64 with LLVM-13 HOT 3
- Remove 'compat' code
- Invalid operand in IRToASTVisitor.cpp:264 HOT 2
- Globals should be sorted using a topological ordering HOT 1
- Ideas for refinement pass improvements / new refinement passes HOT 1
- Inline asm is treated as extern functions and discarded
- Investigate reworking CBR and RBR to match Dream
- Anvill to Rellic does not compile HOT 1
- Improve README
- Canonicalization pass
- Use new user-extension points to inject debug info
- Scheduled CI runs are failing
- rellic decompilation failure HOT 17
- Rellic produces semantically non-equivalent code HOT 1
- Assertion `NewParamInfo.size() == getNumParams() && "Parameter count mismatch!"` failed. HOT 3
- "Exception terminator 'invoke' is not supported yet" HOT 5
- Crash with message "Invalid z3 op" on an IR file. HOT 1
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 rellic.