summaryrefslogtreecommitdiff
path: root/src/ldump.js
diff options
context:
space:
mode:
authorBenoit Giannangeli <giann008@gmail.com>2017-04-24 15:52:27 +0200
committerBenoit Giannangeli <giann008@gmail.com>2017-04-24 15:52:27 +0200
commitfe15ff909f9edbbc485ae66d54d6415bf0843a6d (patch)
tree86842135b2027eb8ce6ef50647982ec42c1fd7c6 /src/ldump.js
parent31dcd12f5a9cd6a45e8ad9d1213a8a25d88fe885 (diff)
downloadfengari-fe15ff909f9edbbc485ae66d54d6415bf0843a6d.tar.gz
fengari-fe15ff909f9edbbc485ae66d54d6415bf0843a6d.tar.bz2
fengari-fe15ff909f9edbbc485ae66d54d6415bf0843a6d.zip
lun/dump.js use 32bit integers
Diffstat (limited to 'src/ldump.js')
-rw-r--r--src/ldump.js8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/ldump.js b/src/ldump.js
index 98c48ef..e35d3be 100644
--- a/src/ldump.js
+++ b/src/ldump.js
@@ -48,10 +48,10 @@ const DumpInt = function(x, D) {
};
const DumpInteger = function(x, D) {
- let dv = new DataView(new ArrayBuffer(8));
+ let dv = new DataView(new ArrayBuffer(4));
dv.setInt32(0, x, true);
let t = [];
- for (let i = 0; i < 8; i++)
+ for (let i = 0; i < 4; i++)
t.push(dv.getUint8(i, true));
DumpBlock(t, 8, D);
};
@@ -176,7 +176,7 @@ const DumpHeader = function(D) {
DumpByte(4, D); // intSize
DumpByte(8, D); // size_tSize
DumpByte(4, D); // instructionSize
- DumpByte(8, D); // integerSize
+ DumpByte(4, D); // integerSize
DumpByte(8, D); // numberSize
DumpInteger(LUAC_INT, D);
DumpNumber(LUAC_NUM, D);
@@ -198,4 +198,4 @@ const luaU_dump = function(L, f, w, data, strip) {
return D.status;
};
-module.exports.luaU_dump = luaU_dump; \ No newline at end of file
+module.exports.luaU_dump = luaU_dump;