aboutsummaryrefslogtreecommitdiff
path: root/src/analyzer.js
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2013-08-13 11:27:13 -0700
committerAlon Zakai <alonzakai@gmail.com>2013-08-13 11:27:13 -0700
commit984e7b2aff83c41a8272058ab4716bfc222ff58e (patch)
treeb30178a207fabb06d7ed43b45348d3fb42cf9109 /src/analyzer.js
parentb639ed59378df54fc0513fb00ac97d0678f8ee6e (diff)
properly parse things like { i8*, { i64, i8* } (i8*)* }, issue #1319
Diffstat (limited to 'src/analyzer.js')
-rw-r--r--src/analyzer.js16
1 files changed, 15 insertions, 1 deletions
diff --git a/src/analyzer.js b/src/analyzer.js
index 931ce421..2a7d64f5 100644
--- a/src/analyzer.js
+++ b/src/analyzer.js
@@ -953,9 +953,23 @@ function analyzer(data, sidePass) {
if (type[0] == '{' || type[0] == '<') {
type = nonPointing;
var packed = type[0] == '<';
+ var internal = type;
+ if (packed) {
+ if (internal[internal.length-1] != '>') {
+ warnOnce('ignoring type ' + internal);
+ return; // function pointer or such
+ }
+ internal = internal.substr(1, internal.length-2);
+ }
+ assert(internal[0] == '{', internal);
+ if (internal[internal.length-1] != '}') {
+ warnOnce('ignoring type ' + internal);
+ return; // function pointer or such
+ }
+ internal = internal.substr(2, internal.length-4);
Types.types[type] = {
name_: type,
- fields: splitTokenList(tokenize(type.substr(2 + packed, type.length - 4 - 2*packed)).tokens).map(function(segment) {
+ fields: splitTokenList(tokenize(internal).tokens).map(function(segment) {
return segment[0].text;
}),
packed: packed,