Fix memory leak when using continue or break statement with syntaxError#5190
Fix memory leak when using continue or break statement with syntaxError#5190gergocs wants to merge 1 commit intojerryscript-project:masterfrom
Conversation
11547fa to
e37002c
Compare
|
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