diff options
author | max99x <max99x@gmail.com> | 2011-08-17 07:44:59 +0300 |
---|---|---|
committer | max99x <max99x@gmail.com> | 2011-08-17 07:44:59 +0300 |
commit | 25630c272ddd8d260f4bd8d60db5f2b01b6a00e8 (patch) | |
tree | 8708398c75748234299abae35dbdb3f8a095a5c6 /src/parseTools.js | |
parent | ee4b6ebf353585fb0eb0809a4b677f5694a9ba79 (diff) | |
parent | c2d71f807a84cb1cfad154c59e9d6859fff3e631 (diff) |
Merge remote-tracking branch 'upstream/master'
Diffstat (limited to 'src/parseTools.js')
-rw-r--r-- | src/parseTools.js | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/parseTools.js b/src/parseTools.js index 91956cad..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)); } @@ -1278,6 +1283,13 @@ function walkInterdata(item, pre, post, obj) { if (walkInterdata(item.params[i], pre, post, obj)) return true; } } + if (item.possibleVars) { // other attributes that might contain interesting data; here, variables + var box = { intertype: 'value', ident: '' }; + for (i = 0; i <= item.possibleVars.length; i++) { + box.ident = item[item.possibleVars[i]]; + if (walkInterdata(box, pre, post, obj)) return true; + } + } return post(item, originalObj, obj); } |