-
Notifications
You must be signed in to change notification settings - Fork 50
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[WIP] mark the end of block also with STOP #52
Conversation
DeepCode analyzed this pull request. |
|
I agree with everything you mention, and I have the same questions regarding Decompiler vs DecompilerFallback. I think I'll first focus on having more tests before we do these changes, so that we can keep track of whether we introduce bugs or not. |
Add a Python script to run securify on multiple input and see whether their outputs match the ones previously saved, so that changes can be acknowledged and bugs introduced can be fixed.
f5e7e4a
to
f7f4faf
Compare
f7f4faf
to
9dea6e3
Compare
For |
Isn't this an example for
|
Yes, and it works also for the other opcodes, so perfect. |
I've added the other opcodes and tests, if the changes are good for you I'll reorganize the commits and merge. |
@@ -209,6 +209,30 @@ public static boolean isInvalid(int opcode) { | |||
return "INVALID".equals(getOpName(opcode)) || opcode == INVALID; | |||
} | |||
|
|||
/** | |||
* Indicate whether the opcode terminates a basic block | |||
* Ignores the case of JUMPI for which it depends on the CFG |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why does JUMPI not end a block?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the code there is a check on controlFlowGraph.get(rawInstruction.offset).contains(ControlFlowDetector.DEST_ERROR)
when a JUMPI
is encountered, meaning that Securify currently does not assume that this is the end of the block just because of this opcode. Ignoring JUMPI
in this function was a way to refactor the code without changing the semantics of the basic blocks Securify currently builds.
Can you briefly explain the changes that are going on in the 238 changed files? How does the end-to-end testing work? From where is it triggered? |
Sorry that should be clearer now, basically I want to wait until the end_to_end_testing branch is merged before we merge this. It just compares the current output with saved output so that we manually acknowledge the changes. See #57 for more details. |
d970396
to
b54522e
Compare
See #68. |
I think this change would make sense given the surrounding code and comments, but not completely sure. This fixes the bug with the empty contract:
Blocked by #57.