From 28a0968294b7001b69174087445d1254cb8a0138 Mon Sep 17 00:00:00 2001 From: Andrzej Janik Date: Sun, 18 Oct 2020 15:06:37 +0200 Subject: [PATCH] Fix small regression --- ptx/src/ptx.lalrpop | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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: (Option, 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))