forked from VirusTotal/yara
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Unification of for-loops with the same codegen, fixing of their (Viru…
…sTotal#1701) ...short-circuit evaluation and usage of none with them. `for .. in` and `for .. of` loops now use the same codegen for their bytecode using 2 instructions `ITER_CONDITION` and `ITER_END`. `ITER_CONDITION` evaluates each iteration whether the condition of the loop was satisfied prematurely or whether the loop is still satisfiable, so essentially making sure that loops are properly short-circuited. `ITER_END` is used for final evaluation of the loop, whether it is satisfied or not, after the iterator got exhausted or the loop was short-circuited. In order to be able to use single codegen for both iterators and string sets, new iterator type was instroduced - `YR_ITERATOR_STRING_SET`. When `ITER_START_STRING_SET` is executed, it is capable of consuming all strings pushed on the stack and construct `YR_ITERATOR_STRING_SET` object which can then be used as a regular iterator.
- Loading branch information
Showing
11 changed files
with
1,937 additions
and
1,754 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.