-
-
Notifications
You must be signed in to change notification settings - Fork 47
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
Feat/short circuit #490
Feat/short circuit #490
Conversation
Static analysis reportLizard reportListing only functions with cyclomatic complexity >= 15 or NLOC >= 100 or parameters >= 6.
Report about files you didn't modify in this PR
CppCheck report
Report files about files you didn't modify in this PR
|
Fuzzing report/usr/local/bin/afl-whatsup status check tool for afl-fuzz by Michal Zalewski Summary stats
Cycles without finds : 0 [+] Captured 30487 tuples (map size 172670, highest value 255, total values 281660253) in '/dev/null'. |
Description
and
andor
should be able to short-circuit. Currently, the following code:would print
ok
twice (because the operator needs to evaluate each argument to give an answer).However we can short-circuit on the first false value for
and
, and on the firsttrue
value foror
, to avoid evaluating unneeded values. This PR implements exactly this behaviour, by removing theAND_
andOR_
instructions, adding aDUP
instruction and usingPOP_JUMP_IF_(TRUE|FALSE)
.Checklist
Documentation will have to be updated since some instructions were removed and other have a new bytecode.