Closed MirkoDziadzka closed 3 months ago
Patch coverage: 85.00
% and project coverage change: -0.11
:warning:
Comparison is base (
b624886
) 90.21% compared to head (2247793
) 90.11%.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.
Ping @anuraaga @manojgop @ns-sundar
There is a sister PR here https://github.com/libinjection/libinjection/pull/36
Kudos, SonarCloud Quality Gate passed!
0 Bugs
0 Vulnerabilities
0 Security Hotspots
0 Code Smells
No Coverage information
0.0% Duplication
I have pushed a commit which I think makes this more idiomatic to Go and readable for future authors, TCO is a feature of compilers, not of code.
@jcchavezs This repo needs to migrate to our standard tooling. Can we create a magefiles
repo in the org to not copy-paste?
And yeah, IMO the long term refactor seems to be to make sure there is only one top-level processing loop where state transitions happen, rather than happen state transitions and iteration to happen piecemeal within different functions.
Yeah we can create standard magefiles inside corazawaf. At least for lint, test, format, tidy this should do the trick.
On Mon, 27 Mar 2023, 03:21 Anuraag Agrawal, @.***> wrote:
And yeah, IMO the long term refactor seems to be to make sure there is only one top-level processing loop where state transitions happen, rather than happen state transitions and iteration to happen piecemeal within different functions.
— Reply to this email directly, view it on GitHub https://github.com/corazawaf/libinjection-go/pull/17#issuecomment-1484328670, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAXOYAW5DJPGKUCERRO7233W6DTR7ANCNFSM6AAAAAAWHBVQNI . You are receiving this because you were mentioned.Message ID: @.***>
@anuraaga @jcchavezs what is the state of this change? are we pushing this one and then doing a better change?
Merging.
There is a recursion loop between stateSelfClosingStartTag and stateSelfClosingStartTag which in the worst case consumes 2 stack frames per input character.
We avoid this recursion by manual implementing tail call optimization (TCO) which a go compiler does not do automatically.
Also add a unit test to reproduce the problem in the first place.
This fixes #16