diff options
author | alon@honor <none@none> | 2010-09-25 20:26:16 -0700 |
---|---|---|
committer | alon@honor <none@none> | 2010-09-25 20:26:16 -0700 |
commit | b94c061e122f155cc5c1262a1bb470cb49ee04b4 (patch) | |
tree | 134322b7ed16b9a3ed805d4663e3233625d5ef7a /src/postamble.js | |
parent | 481dec302bfb02b574741c4e505d274718854dff (diff) |
optional memory alignment that matches c/c++; used in clang, not in llvm-gcc
Diffstat (limited to 'src/postamble.js')
-rw-r--r-- | src/postamble.js | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/postamble.js b/src/postamble.js index c156cd21..a34370b2 100644 --- a/src/postamble.js +++ b/src/postamble.js @@ -3,9 +3,16 @@ function run(args) { var argc = args.length+1; + function pad() { + for (var i = 0; i < QUANTUM_SIZE-1; i++) { + argv.push(0); + } + } var argv = [Pointer_make(intArrayFromString("/bin/this.program")) ]; + pad(); for (var i = 0; i < argc-1; i = i + 1) { argv.push(Pointer_make(intArrayFromString(args[i]))); + pad(); } argv = Pointer_make(argv); |