Skip to content

Commit 0086cf1

Browse files
authored
Merge pull request #340 from kyleheadley/bugfix#272
Bugfix#272
2 parents bc25387 + d3d5733 commit 0086cf1

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

clang/lib/3C/ConstraintVariables.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -605,7 +605,7 @@ std::string PointerVariableConstraint::mkString(const EnvironmentMap &E,
605605
if (!ForItype && BaseType == "void")
606606
K = Atom::A_Wild;
607607

608-
if (PrevArr && K != Atom::A_Arr && !EmittedName) {
608+
if (PrevArr && arrSizes.at(TypeIdx).first != O_SizedArray && !EmittedName) {
609609
EmittedName = true;
610610
addArrayAnnotations(CheckedArrs, EndStrs);
611611
EndStrs.push_front(" " + getName());

clang/test/3C/patch_issue_272.c

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
// RUN: 3c -alltypes %s -- | FileCheck -match-full-lines %s
2+
3+
/********************************************************************/
4+
/* Tests to keep pointer level from */
5+
/* https://github.com/correctcomputation/checkedc-clang/issues/272 */
6+
/********************************************************************/
7+
8+
int *a[];
9+
void b() { a[0][0]; }
10+
11+
// CHECK: _Array_ptr<int> a _Checked[1] = {((void *)0)};

0 commit comments

Comments
 (0)