diff options
author | Alon Zakai <alonzakai@gmail.com> | 2013-11-28 18:22:13 -0800 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2013-11-28 18:22:13 -0800 |
commit | 74304761ffb75177c54597379cec34b1c2710284 (patch) | |
tree | d9260c16fb6d194c935191d0c4c21a4839892d72 /src/intertyper.js | |
parent | 40258fa6e8dffd4b3f63a08dccc772458c3959aa (diff) |
fix bitcast type when the input is an llvm function like getelementptr
Diffstat (limited to 'src/intertyper.js')
-rw-r--r-- | src/intertyper.js | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/intertyper.js b/src/intertyper.js index 15f619a1..b34d0c08 100644 --- a/src/intertyper.js +++ b/src/intertyper.js @@ -638,7 +638,8 @@ function intertyper(lines, sidePass, baseLineNums) { // 'bitcast' function bitcastHandler(item) { item.intertype = 'bitcast'; - item.type = item.tokens[4].text; // The final type + var last = getTokenIndexByText(item.tokens, ';'); + item.type = item.tokens[Math.min(last, item.tokens.length-1)].text; // The final type Types.needAnalysis[item.type] = 0; var to = getTokenIndexByText(item.tokens, 'to'); item.params = [parseLLVMSegment(item.tokens.slice(1, to))]; |