diff options
author | Alon Zakai <alonzakai@gmail.com> | 2011-08-14 21:55:00 -0700 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2011-08-14 21:55:00 -0700 |
commit | bae64f351185d457d6dd7e4e7c7208eb3a25169d (patch) | |
tree | f63bcb9c7833d661da2b964ce9d63ffb6d6fd3e8 /src/parseTools.js | |
parent | 80e978c04c8d23626c7edc63897b3dd44cd24f26 (diff) |
fix bug with storing aggregates
Diffstat (limited to 'src/parseTools.js')
-rw-r--r-- | src/parseTools.js | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/parseTools.js b/src/parseTools.js index 5c746de0..6eb95593 100644 --- a/src/parseTools.js +++ b/src/parseTools.js @@ -730,6 +730,11 @@ function makeSetValue(ptr, pos, value, type, noNeedFirst, ignore) { if (isStructType(type)) { var typeData = Types.types[type]; var ret = []; + // We can receive either an object - an object literal that was in the .ll - or a string, + // which is the ident of an aggregate struct + if (typeof value === 'string') { + value = range(typeData.fields.length).map(function(i) { return value + '.f' + i }); + } for (var i = 0; i < typeData.fields.length; i++) { ret.push(makeSetValue(ptr, pos + typeData.flatIndexes[i], value[i], typeData.fields[i], noNeedFirst)); } |