Skip to content
This repository has been archived by the owner on Oct 16, 2021. It is now read-only.

Added for loop to Encode function to support big-endian machines #50

Merged
merged 1 commit into from
Oct 28, 2015

Conversation

exinfinitum
Copy link

This is a quick fix for nodejs/node#3409, pulling over code from v0.12. This fix has not yet been finalized in the community node.js version.

Used stack allocation instead of heap allocation to improve speed of endianness correction
joransiu added a commit that referenced this pull request Oct 28, 2015
Swap bytes for UCS2 in StringBytes::Encode on Big Endian platforms
@joransiu joransiu merged commit ee31ae7 into ibmruntimes:v4.x-port Oct 28, 2015
@joransiu
Copy link
Member

Thanks @exinfinitum. We'll incorporate this fix temporarily to ensure address the issue is not exposed for our big-endian platforms. We'll replace with the community fix once that is finalized.

@joransiu
Copy link
Member

There is an issue with this fix, as StringSlice also includes a byteswap for UCS2. This led to some Node FVT failures with StringBuffer due to double swapping. The proper change should be having the byteswap in String::Encode. We'll need a follow-on fix to update StringSlice.

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

Successfully merging this pull request may close these issues.

2 participants