Commit Graph

348 Commits

Author SHA1 Message Date
GawdOfROFL
8245b79989 add RERAISE_A 2021-10-10 14:58:46 +05:30
GawdOfROFL
43667f0bae make requested changes 2021-10-10 06:48:34 +05:30
GawdOfROFL
728309e7f8 add newline 2021-10-10 00:57:37 +05:30
GawdOfROFL
e4e3a9f4ed added python 3.10 support 2021-10-10 00:52:41 +05:30
Michael Hansen
fd6985370d Merge pull request #200 from dotjrich/list-extend
Adds support for LIST_EXTEND opcode
2021-10-07 09:25:43 -06:00
John Richards
15f2a4013e Adds an extra test case 2021-10-07 02:02:00 -04:00
John Richards
a504452b7b Adds support for LIST_EXTEND opcode
Addresses #199
2021-10-07 01:51:53 -04:00
Michael Hansen
6140b4b33e Protect against out of range lookups in pycdas
Fixes #198.
2021-08-16 15:25:16 +00:00
Michael Hansen
fbf9d24de3 Merge pull request #189 from zrax/codeql
Fix CodeQL analysis for C++
2021-04-12 10:16:07 -07:00
Michael Hansen
56e549640f Fix format-truncation warning in bytecode.cpp 2021-04-12 10:12:45 -07:00
Michael Hansen
768da6f1e6 Fix CodeQL analysis for C++ 2021-04-12 10:08:31 -07:00
Michael Hansen
ac189cc916 Support LOAD_METHOD and CALL_METHOD from Python 3.7+
Fixes #163
2021-04-12 09:55:52 -07:00
Michael Hansen
f0d2d802dc [pymultic] Update python versions 2021-04-12 09:01:01 -07:00
Michael Hansen
74ff8e277a Merge pull request #187 from zrax/codeql
Create codeql-analysis.yml
2020-10-26 09:30:48 -07:00
Michael Hansen
281e8da7eb Don't build CI on non-master pushes 2020-10-26 09:29:21 -07:00
Michael Hansen
040b0f3360 Create codeql-analysis.yml 2020-10-26 09:25:26 -07:00
Michael Hansen
133dfca012 Merge pull request #186 from Aralox/Issue-185-chained-assignment
Support chained assignment statements, e.g. `a = b = c`
2020-10-26 08:40:50 -07:00
Aralox
bd7439485f CRA 2020-10-26 15:18:43 +11:00
Aralox
23beda48d7 CRAs 2020-10-26 15:15:45 +11:00
Aralox
a987c34e65 Merge remote-tracking branch 'upstream/master' into Issue-185-chained-assignment 2020-10-25 12:13:37 +11:00
Michael Hansen
0a82954c58 Merge pull request #184 from Aralox/Issue-183-support-unpack-empty
Support unpacking empty list.
2020-10-24 14:15:47 -07:00
Aralox
7a89b72260 Support chained assignment statements, e.g. a = b = c.
We know when we have begun a chained assignment when we process a DUP_TOP with non-null on the stack. Push a NODE_CHAINSTORE onto the stack when this happens, and keep it 'floating' on top of the stack for all STORE_X operations until the stack is empty.
To support versions of Python <= 2.5 which use DUP_TOP in more places, I modified ROT_TWO, ROT_THREE and ROT_FOUR to get rid of NODE_CHAINSTORE on the stack if it is present.
2020-10-23 21:19:01 +11:00
Aralox
1db8d28729 Add compiled test for python 2.7 2020-10-23 14:30:42 +11:00
Aralox
db94f3c257 CRLF -> LF 2020-10-23 11:28:42 +11:00
Aralox
8e8bb95592 Support unpacking empty list.
If UNPACK_SEQUENCE with operand 0 is encountered, treat it like a STORE_X and either assign the TOS to it or set it as the for-loop index.
Issue #183.
2020-10-23 11:23:46 +11:00
Michael Hansen
8eb18de269 Update tests to show that #39 is resolved, and add dummy support for
STORE_LOCALS used in Python 3.0-3.3.

Closes #39
Closes #63
2020-10-22 09:06:57 -07:00
Michael Hansen
0540b3991c Merge pull request #181 from Aralox/Issue-124-handle-async-for-GET_AITER_GET_ANEXT
Add support for `async for`
2020-10-22 08:24:56 -07:00
Michael Hansen
378c25685b Merge pull request #182 from dotjrich/issue-169
Adds support for SETUP_ANNOTATION op and variable annotations
2020-10-22 08:21:28 -07:00
Aralox
7022db1bf6 Modify async for test to avoid known try-except problem with trailing unnecessary continue when the try-except is not followed by any other statements.
Add an xfail test to capture this failing scenario.
2020-10-22 15:35:59 +11:00
John Richards
7ba44361fe Addresses code review comments 2020-10-21 23:45:51 -04:00
John Richards
345035b544 Adds support for SETUP_ANNOTATION op and variable annotations
Tests have also been added.

Fixes #169
2020-10-21 21:42:13 -04:00
Aralox
abf8501ccf CRAs 2020-10-22 10:57:49 +11:00
Aralox
e80aa996fa Only initialize the async for once. 2020-10-22 09:11:51 +11:00
Aralox
5bdc0b5baf Merge remote-tracking branch 'upstream/master' into Issue-124-handle-async-for-GET_AITER_GET_ANEXT
Conflicts:
	ASTree.cpp
2020-10-21 19:34:37 +11:00
Aralox
91a23f914d Implement better handling for async for.
Instead of ignoring boilerplate when decompiling `async for`, build the loop semantically by deconstructing the BLK_WHILE -> BLK_CONTAINER -> BLK_TRY that python generates when compiling an `async for` (see https://www.python.org/dev/peps/pep-0492/#asynchronous-iterators-and-async-for).
When reading GET_AITER, convert the BLK_WHILE into a BLK_ASYNCFOR in the same way as a `for` loop.
Ignore GET_ANEXT.
Use END_FINALLY as the trigger to finish building the BLK_ASYNCFOR:
-> Extract the loop variable from the contents of the BLK_TRY.
-> Throw away the BLK_TRY and BLK_CONTAINER, leave the BLK_ASYNCFOR on top of the stack.
2020-10-21 19:32:20 +11:00
Michael Hansen
d3a46f711f Merge remote-tracking branch 'dotjrich/issue-172' into master 2020-10-20 21:10:55 -07:00
Michael Hansen
e616471003 Merge branch 'Issue-165-literal-string-interpolation-f-strings' into master 2020-10-20 21:08:19 -07:00
Michael Hansen
568867c80a Minor style adjustments 2020-10-20 21:08:02 -07:00
Aralox
db12d15e08 Fix token_dump for strings with single quotes in them. Update f-string test tokens. 2020-10-21 10:38:58 +11:00
John Richards
50dea39975 Addresses a couple performance related comments 2020-10-20 18:07:39 -04:00
Aralox
8933c9a4a9 Add support for async for. Issue #124
Ignore 'boilerplate' opcodes that set up the async iteration logic internally (https://www.python.org/dev/peps/pep-0492/#asynchronous-iterators-and-async-for) - We don’t need any of this as GET_AITER is enough to tell us that we are in an `async for`.
2020-10-20 20:39:23 +11:00
John Richards
5b819fa23e Adds support for BUILD_CONST_KEY_MAP opcode
Tests have also been added.

Fixes #172
2020-10-20 01:46:38 -04:00
Aralox
7af40a779f CRAs 2020-10-20 16:42:19 +11:00
Michael Hansen
8fdfe170fc Ensure tarball directory is created before trying to download to it 2020-10-19 22:04:56 -07:00
Michael Hansen
0a54e40c8d Merge pull request #179 from dotjrich/debug-docs
Adds ability to control block and stack debug output via CMake
2020-10-19 22:02:20 -07:00
John Richards
0573318528 Renames options for BLOCK/STACK debugging and fixes indentation 2020-10-20 00:42:44 -04:00
John Richards
05c373b07a Adds ability to control block and stack debug output via CMake
Also updates README to detail how to enable various debug options.

A typo related to running tests has also been fixed.
2020-10-19 20:55:20 -04:00
Aralox
1f07a24451 Fix up some dodgy spacing 2020-10-17 21:04:39 +11:00
Aralox
0c9fbd9caf Issue-165 Added support for f-strings (literal string interpolation https://www.python.org/dev/peps/pep-0498/)
Opcodes handled: FORMAT_VALUE, BUILD_STRING.
Added AST node classes for FormattedValue and JoinedStr.
2020-10-17 20:52:57 +11:00
Michael Hansen
9407b29451 Merge pull request #175 from dotjrich/issue-136
Handle NaN and infinity values
2020-10-15 19:19:55 -07:00