Skip to content
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: bitmask overflow better handle global #4063

Conversation

tanhauhau
Copy link
Member

@tanhauhau tanhauhau commented Dec 7, 2019

Fix #4037

  • bitmask array could be an empty array, because the dirty names are not in context.
    • now return dirty & 0 to match the current output.
  • cached the bitmask array, the dirty Expression#type could have been accessed multiple times, causing the bitmask to be re-calculated more than once.
    • but a better fix should be a better lazy creation through getter indirection

@tanhauhau tanhauhau force-pushed the tanhauhau/bitmask-overflow-with-global-variable branch 3 times, most recently from 6188acf to 6945862 Compare December 7, 2019 12:26
if (member.index.value === -1) {
throw new Error(`unset index`);
}
if (!member) return bitmask;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Returning bitmask doesn't actually do anything anymore, right? We should just be returning here, because this is a forEach now (and the return bitmask; at the end should be completely removed I think).

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yea you are right

@Conduitry
Copy link
Member

Haha oops thanks. I was just about to push that. I misread which parts were inside the forEach.

@tanhauhau
Copy link
Member Author

no worries. 😏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3.16 Reduce of empty array with no initial value
2 participants