summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorFlier Lu <flier.lu@gmail.com>2017-01-28 22:12:42 +0800
committerFlier Lu <flier.lu@gmail.com>2017-01-28 22:12:42 +0800
commita00e8b03da825e13a809234abcace81d6cf59335 (patch)
treee7f0f13f33007929fd9e8bbd5653d896981ba640 /src
parent7d995d75e07798c1527d5ea3dd8a647ed79fe209 (diff)
treat incomplete array as zero length array
fix issue #455
Diffstat (limited to 'src')
-rw-r--r--src/ir/ty.rs11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/ir/ty.rs b/src/ir/ty.rs
index 1e87beb4..96a6e6a2 100644
--- a/src/ir/ty.rs
+++ b/src/ir/ty.rs
@@ -816,8 +816,7 @@ impl Type {
}
// XXX DependentSizedArray is wrong
CXType_VariableArray |
- CXType_DependentSizedArray |
- CXType_IncompleteArray => {
+ CXType_DependentSizedArray => {
let inner = Item::from_ty(ty.elem_type().as_ref().unwrap(),
location,
parent_id,
@@ -825,6 +824,14 @@ impl Type {
.expect("Not able to resolve array element?");
TypeKind::Pointer(inner)
}
+ CXType_IncompleteArray => {
+ let inner = Item::from_ty(ty.elem_type().as_ref().unwrap(),
+ location,
+ parent_id,
+ ctx)
+ .expect("Not able to resolve array element?");
+ TypeKind::Array(inner, 0)
+ }
CXType_FunctionNoProto |
CXType_FunctionProto => {
let signature = try!(FunctionSig::from_ty(ty,