-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Resolves Bug#8971506. Defer parse case, assertions due to ByteCodeEmitter aggressively emitting nodes unprocessed yet by ByteCodeGenerator. #2306
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
Resolves Bug#8971506. Defer parse case, assertions due to ByteCodeEmitter aggressively emitting nodes unprocessed yet by ByteCodeGenerator. #2306
Conversation
|
Hi @atulkatti, I'm your friendly neighborhood Microsoft Pull Request Bot (You can call me MSBOT). Thanks for your contribution!
TTYL, MSBOT; |
| this->EmitOneFunction(pnode); | ||
| this->EndEmitFunction(pnode); | ||
|
|
||
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.
extra space here.
|
@Microsoft/chakra-developers |
| newByteLength = mappedLength * elementSize; | ||
|
|
||
| if ((uint32)mappedLength > (byteLength - offset)/ elementSize) | ||
| if (offset + newByteLength > byteLength) |
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.
Aren't these and many other changes in this PR part of #2289?
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.
No. Please only look at the last commit with message "Resolves Bug#8971506...". The other commits are a result of a merge I did after pushing my branch. But those commits are already merged to release/1.4 branch. Sorry about the confusion.
|
LGTM |
|
Looks good |
…tter aggressively emitting nodes unprocessed yet by ByteCodeGenerator.
|
The symptom you describe puzzles me. Can you may out an example of how this happens? |
dilijev
left a comment
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.
LGTM but wait for someone with better knowledge of the parser to sign off.
| (eval(` | ||
| function f7(a3 = class c4 extends false { | ||
| }) { }; | ||
| `)); |
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.
Is the extra set of parens around the eval(...) necessary to set up the scopes correctly to repro the issue?
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.
No, the extra set of parenthesis aren't necessary.
|
Could the similar problem happen in other places? |
|
A more appropriate fix for this bug is to remove the isEnclosedInParamScope flag. Once that happens this fix will not be required. |
In defer parse cases, sometimes byte code emitter seems to aggressively process nested scopes that the byte code generator hasn't visited. This results in assertion failures as certain flags are not set as expected. This surfaces more in cases where parameter scope has a class declaration and either the class declaration has an eval or the enclosing function is in an eval/global eval.