Skip to content

Conversation

@juj
Copy link
Collaborator

@juj juj commented Jun 6, 2020

No description provided.

Comment on lines +2265 to +2267
uint8Array[j++] = base64ReverseLookup[b64.charCodeAt(i)] << 2 | b1 >> 4;
if (j < end) uint8Array[j++] = b1 << 4 | b2 >> 2;
if (j < end) uint8Array[j++] = b2 << 6 | base64ReverseLookup[b64.charCodeAt(i+3)];

This comment was marked as resolved.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Hmm, that version looks like it would write

uint8Array[j] = b2 << 6 | base64ReverseLookup[b64.charCodeAt(i+3)];

on line 2267, and then not increment j, so then on the next iteration,

uint8Array[j] = base64ReverseLookup[b64.charCodeAt(i)] << 2 | b1 >> 4;

on line 2265 would end up writing on top of the same index, stomping the previous value?

Copy link
Contributor

@MaxGraey MaxGraey Jun 6, 2020

Choose a reason for hiding this comment

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

Ah, I didn't see this inside loop. In this case that's not relevant

@juj juj merged commit 7fdec37 into WebAssembly:master Jun 6, 2020
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 participants