diff options
Diffstat (limited to 'src/runtime.js')
-rw-r--r-- | src/runtime.js | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/runtime.js b/src/runtime.js index 6defbb35..816d864f 100644 --- a/src/runtime.js +++ b/src/runtime.js @@ -280,7 +280,10 @@ var Runtime = { offset = offset || 0; type = (typeof Types === 'undefined' ? Runtime.typeInfo : Types.types)[typeName]; if (!type) return null; - assert(type.fields.length === struct.length, 'Number of named fields must match the type for ' + typeName); + if (type.fields.length != struct.length) { + printErr('Number of named fields must match the type for ' + typeName + ': possibly duplicate struct names. Cannot return structInfo'); + return null; + } alignment = type.flatIndexes; } else { var type = { fields: struct.map(function(item) { return item[0] }) }; |