summaryrefslogtreecommitdiff
path: root/test/wasm2js/base64.wast
diff options
context:
space:
mode:
authorYury Delendik <ydelendik@mozilla.com>2018-09-05 17:35:46 -0500
committerGitHub <noreply@github.com>2018-09-05 17:35:46 -0500
commitf831369f8586f86cafe10ee4f34c9b1f239abbfc (patch)
tree46e2ff1189c3d64e21efdf684e6a2b32557abb6f /test/wasm2js/base64.wast
parenta0cbc9dbbfcfd5bb254da904c19e3f6b0a1716c1 (diff)
downloadbinaryen-f831369f8586f86cafe10ee4f34c9b1f239abbfc.tar.gz
binaryen-f831369f8586f86cafe10ee4f34c9b1f239abbfc.tar.bz2
binaryen-f831369f8586f86cafe10ee4f34c9b1f239abbfc.zip
[wasm2js] Fix base64 encoding (#1670)
The static std::string base64Encode(std::vector<char> &data) { uses signed char in input data. The ((int)data[0]) converts it the signed int, making '\xFF' char into -1. The patch fixes casting.
Diffstat (limited to 'test/wasm2js/base64.wast')
-rw-r--r--test/wasm2js/base64.wast4
1 files changed, 4 insertions, 0 deletions
diff --git a/test/wasm2js/base64.wast b/test/wasm2js/base64.wast
new file mode 100644
index 000000000..ccca92c8a
--- /dev/null
+++ b/test/wasm2js/base64.wast
@@ -0,0 +1,4 @@
+(module
+ (memory $memory 1 1)
+ (data (i32.const 2) "\00\fe\ff")
+) \ No newline at end of file