summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--ptx/src/ptx.lalrpop5
1 files changed, 4 insertions, 1 deletions
diff --git a/ptx/src/ptx.lalrpop b/ptx/src/ptx.lalrpop
index 4624580..c066ae4 100644
--- a/ptx/src/ptx.lalrpop
+++ b/ptx/src/ptx.lalrpop
@@ -1345,7 +1345,10 @@ VariableArrayOrPointer<T>: (Option<u32>, T, &'input str, ast::ArrayOrPointer) =
if dims.len() > 1 && dims.contains(&0) {
return Err(ParseError::User { error: ast::PtxError::ZeroDimensionArray })
}
- ast::ArrayOrPointer::Pointer
+ match &*dims {
+ [0] => ast::ArrayOrPointer::Pointer,
+ _ => ast::ArrayOrPointer::Array { dimensions: dims, init: Vec::new() }
+ }
}
};
Ok((align, typ, name, array_init))