aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2011-08-31 18:11:38 -0700
committerAlon Zakai <alonzakai@gmail.com>2011-08-31 18:11:38 -0700
commitb2dfbe2ca1811afd89d939fda2fa24ec5a2715c8 (patch)
tree768849828e8a691ff5e464f65a12fab091b68e3c /src
parent7565b00cce206bb7fd8899ba121e412996d0d8e2 (diff)
fixes for insertvalue
Diffstat (limited to 'src')
-rw-r--r--src/jsifier.js8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/jsifier.js b/src/jsifier.js
index 82642f6b..1c512581 100644
--- a/src/jsifier.js
+++ b/src/jsifier.js
@@ -741,12 +741,12 @@ function JSify(data, functionsOnly, givenFunctions, givenGlobalVariables) {
});
makeFuncLineActor('insertvalue', function(item) {
assert(item.indexes.length == 1); // TODO: see extractvalue
- var ret, ident;
+ var ret = '(', ident;
if (item.ident === 'undef') {
- ident = 'tempValue';
- ret += ident + ' = ' + makeEmptyStruct(item.type) + ', ';
+ item.ident = 'tempValue';
+ ret += item.ident + ' = [' + makeEmptyStruct(item.type) + '], ';
}
- return item.ident + '.f' + item.indexes[0][0].text + ' = ' + finalizeLLVMParameter(item.value) + ', ' + item.ident;
+ return ret + item.ident + '.f' + item.indexes[0][0].text + ' = ' + finalizeLLVMParameter(item.value) + ', ' + item.ident + ')';
});
makeFuncLineActor('indirectbr', function(item) {
return makeBranch(finalizeLLVMParameter(item.pointer), item.currLabelId, true);