Skip to content

Commit

Permalink
scrypt.js: apply patch to avoid warning from compiled code
Browse files Browse the repository at this point in the history
  • Loading branch information
ttyridal committed Sep 29, 2015
1 parent c510b28 commit 88ea0c9
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
3 changes: 2 additions & 1 deletion libscrypt/Makefile
Expand Up @@ -20,7 +20,8 @@ scrypt.js: scrypt.c
emcc scrypt.c crypto_scrypt-nosse.c sha256.c -o scrypt.js -Os --js-opts 0 -Wno-pointer-sign --memory-init-file 0 -s TOTAL_MEMORY=67108864 -s EXPORTED_FUNCTIONS="['_scrypt','_scrypt_hmac_sha256','_sha256_digest','_mp_key','_mp_seed','_mp_clean','_get_masterkey']"
#manual steps: remove lot's of unused stuff
patch < remove_cruft.patch
#cat wrapper.js >> scrypt.js
#and a bug from compiler output
patch < fix_redeclared_variable.patch
scrypt-asm.js: scrypt.js
python $(EMSCRIPTEN)/tools/js_optimizer.py scrypt.js asm cleanup asmLastOpts minifyWhitespace eliminate eliminateMemSafe simplifyExpressions simplifyIfs optimizeFrounds registerize minifyNames last noop
mv scrypt.js.jsopt.js scrypt-asm.js
Expand Down
12 changes: 12 additions & 0 deletions libscrypt/fix_redeclared_variable.patch
@@ -0,0 +1,12 @@
--- scrypt.js.orig 2015-09-29 19:48:17.285275516 +0200
+++ scrypt.js 2015-09-29 19:49:08.725274595 +0200
@@ -477,7 +477,8 @@
}

if (zeroinit) {
- var ptr = ret, stop;
+ var stop;
+ ptr = ret;
assert((ret & 3) == 0);
stop = ret + (size & ~3);
for (; ptr < stop; ptr += 4) {

0 comments on commit 88ea0c9

Please sign in to comment.