-
Notifications
You must be signed in to change notification settings - Fork 675
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
Fix memory leak when using continue or break statement with syntaxError #5190
base: master
Are you sure you want to change the base?
Conversation
11547fa
to
e37002c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Title: whit -> with
Does this patch increase memory consumption in the normal (no parse error) case? |
Yes it does. For example the |
Would it be possible to free the memory at its regular place as well? |
I don't think so. I have debugging this issue a very long time and didn't find any better methods to keep track of possible non freed pointers. |
I mean when a pointer is not needed, it could be removed from the tracker and free it. I suspect we keep pointers too long around this way. |
0bf29cb
to
66c17dd
Compare
This patch fixes jerryscript-project#5062. JerryScript-DCO-1.0-Signed-off-by: Gergo Csizi gergocs@inf.u-szeged.hu
66c17dd
to
762c5a7
Compare
jerryscript/jerry-core/parser/js/js-parser.c Line 3254 in 8d44eed
The parser already does a lot of cleanup on throw. If we could put this branch list into some local context (a chain list with a head), we could cleanup it without complex structures. |
Currently it is a chain list not a complex structure and stored in the context to easily pass around. |
Not the complexity, but it has while loops. The design is better if less scanning is needed. Is it operating like a stack btw? So we usually remove items form the end? |
No, it's not like stack. |
This patch fixes #5062.
JerryScript-DCO-1.0-Signed-off-by: Gergo Csizi gergocs@inf.u-szeged.hu