-
Notifications
You must be signed in to change notification settings - Fork 684
Prevent arguments object creation if 'arguments' function argument is present #4849
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
Prevent arguments object creation if 'arguments' function argument is present #4849
Conversation
d8d2ec7
to
fbb1d4c
Compare
… present This patch fixes jerryscript-project#4847. JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik [email protected]
fbb1d4c
to
3bb042b
Compare
{ | ||
/* 'arguments' function argument existence should prevent the arguments object construction */ | ||
new_literal_pool_p->status_flags = | ||
(uint16_t) (new_literal_pool_p->status_flags |
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.
Incorrect style.
@@ -1246,6 +1246,7 @@ scanner_filter_arguments (parser_context_t *context_p, /**< context */ | |||
|
|||
if (has_arguments) | |||
{ | |||
/* Force the lexically stored arguments object creation */ | |||
literal_pool_p->status_flags |= (SCANNER_LITERAL_POOL_ARGUMENTS_IN_ARGS | SCANNER_LITERAL_POOL_NO_ARGUMENTS); |
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.
I would put the argument checking as a for loop here since the while (true)
loop might also exit. This case is rare, so an extra loop should not cost much.
Note:
still crashes |
This patch is the followup of jerryscript-project#4849. JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik [email protected]
This patch is the followup of jerryscript-project#4849. JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik [email protected]
This patch is the followup of #4849. JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik [email protected]
This patch fixes #4847.
JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik [email protected]