diff options
-rw-r--r-- | src/jsifier.js | 2 | ||||
-rw-r--r-- | src/parseTools.js | 5 |
2 files changed, 4 insertions, 3 deletions
diff --git a/src/jsifier.js b/src/jsifier.js index e24b8e73..d2d782c7 100644 --- a/src/jsifier.js +++ b/src/jsifier.js @@ -258,7 +258,7 @@ function JSify(data, functionsOnly, givenFunctions, givenGlobalVariables) { // Set the actual value in a postset, since it may be a global variable. TODO: handle alias of alias (needs ordering) ret.push({ intertype: 'GlobalVariablePostSet', - JS: item.ident + ' = ' + finalizeLLVMParameter(item.value) + ';' + JS: item.ident + ' = ' + finalizeLLVMParameter(item.value, true) + ';' // do *not* indexize functions here }); return ret; } diff --git a/src/parseTools.js b/src/parseTools.js index 311f1f22..70071d04 100644 --- a/src/parseTools.js +++ b/src/parseTools.js @@ -1078,7 +1078,7 @@ function handleOverflow(text, bits) { } // From parseLLVMSegment -function finalizeLLVMParameter(param) { +function finalizeLLVMParameter(param, noIndexizeFunctions) { var ret; if (isNumber(param)) { return param; @@ -1098,7 +1098,8 @@ function finalizeLLVMParameter(param) { throw 'invalid llvm parameter: ' + param.intertype; } assert(param.type || (typeof param === 'string' && param.substr(0, 6) === 'CHECK_'), 'Missing type for param: ' + dump(param)); - return indexizeFunctions(ret, param.type); + if (!noIndexizeFunctions) ret = indexizeFunctions(ret, param.type); + return ret; } function makeSignOp(value, type, op) { |