diff options
author | Alon Zakai <alonzakai@gmail.com> | 2011-12-31 13:54:16 -0800 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2011-12-31 13:54:16 -0800 |
commit | 8fa566b01a5dea37d0d73e503ed29e4af39687ca (patch) | |
tree | bcb199a0c8dce88c83b87ab7ce834fc3a95dbd2d /src/parseTools.js | |
parent | c3af81d6df7de206890b5f1a9f9e67bb7a02d1aa (diff) |
support ptrtoint into i64 in i64 mode 1
Diffstat (limited to 'src/parseTools.js')
-rw-r--r-- | src/parseTools.js | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/parseTools.js b/src/parseTools.js index 7f837419..88c7ce68 100644 --- a/src/parseTools.js +++ b/src/parseTools.js @@ -1652,7 +1652,7 @@ function processMathop(item) { return '((' + ident1 + '[0]) & ' + (Math.pow(2, bitsLeft)-1) + ')'; } case 'select': return ident1 + ' ? ' + makeCopyI64(ident2) + ' : ' + makeCopyI64(ident3); - case 'ptrtoint': throw 'Pointers cannot be 64-bit!'; + case 'ptrtoint': return makeI64(ident1, 0); case 'inttoptr': return '(' + ident1 + '[0])'; // just directly truncate the i64 to a 'pointer', which is an i32 // Dangerous, rounded operations. TODO: Fully emulate case 'add': warnI64_1(); return handleOverflow(splitI64(mergeI64(ident1) + '+' + mergeI64(ident2)), bits); |