Skip to content

PY: revert group sequences of chars#12514

Draft
erik-krogh wants to merge 1 commit into
github:mainfrom
erik-krogh:revert-normal-char
Draft

PY: revert group sequences of chars#12514
erik-krogh wants to merge 1 commit into
github:mainfrom
erik-krogh:revert-normal-char

Conversation

@erik-krogh
Copy link
Copy Markdown
Contributor

@erik-krogh erik-krogh commented Mar 14, 2023

THIS PR IS FOR NOTE-TAKING AND DISCUSSION, NOT FOR MERGING (yet)

This is a partial revert of https://github.com/github/codeql/pull/8166/files

I've updated the test-output to reflect the new results we gain from this revert.

This only touches Python, but Ruby/Java is also relevant.

CVE-2017-18361: TP
(Other security issue): TP (with constant-folding).

@erik-krogh erik-krogh added the WIP This is a work-in-progress, do not merge yet! label Mar 14, 2023
@aibaars
Copy link
Copy Markdown
Contributor

aibaars commented Mar 14, 2023

If I remember correctly the purpose of the change that gets reverted in this PR is to reduce the number of regex AST nodes by grouping sequences of normal characters into a single node instead of separate nodes for each character. Without this I think there is a risk of performance degradation for large strings (that may not even be actual regular expressions).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Python WIP This is a work-in-progress, do not merge yet!

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants