aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/intertyper.js8
-rw-r--r--src/parseTools.js7
2 files changed, 14 insertions, 1 deletions
diff --git a/src/intertyper.js b/src/intertyper.js
index 95b1fcd3..232025cb 100644
--- a/src/intertyper.js
+++ b/src/intertyper.js
@@ -632,11 +632,17 @@ function intertyper(data, parseFunctions, baseLineNum) {
}
});
// 'alloca'
+ var allocaPossibleVars = ['allocatedNum'];
substrate.addActor('Alloca', {
processItem: function(item) {
item.intertype = 'alloca';
item.allocatedType = item.tokens[1].text;
- item.allocatedNum = (item.tokens.length > 3 && Runtime.isNumberType(item.tokens[3].text)) ? toNiceIdent(item.tokens[4].text) : 1;
+ if (item.tokens.length > 3 && Runtime.isNumberType(item.tokens[3].text)) {
+ item.allocatedNum = toNiceIdent(item.tokens[4].text);
+ item.possibleVars = allocaPossibleVars;
+ } else {
+ item.allocatedNum = 1;
+ }
item.type = addPointing(item.tokens[1].text); // type of pointer we will get
Types.needAnalysis[item.type] = 0;
item.type2 = item.tokens[1].text; // value we will create, and get a pointer to
diff --git a/src/parseTools.js b/src/parseTools.js
index 91956cad..5c746de0 100644
--- a/src/parseTools.js
+++ b/src/parseTools.js
@@ -1278,6 +1278,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);
}